AccessLogger

AccessLogger

new AccessLogger()

Source:

Access Logger for HTTP Web Servers

Members

combined :boolean

Source:

log format as combined, with user agent: %h %e %^[%x] "%r" %s %b "%R" "{%u}"

Type:
  • boolean

logsIncludeHostname :boolean

Source:

log format for vhosts %v, ex: %h %e %^[%x] "{%v}" "%r" %s %b "%R"

Type:
  • boolean

Methods

formattedDate(timeStamp) → {string}

Source:
Parameters:
Name Type Description
timeStamp Date
Returns:
Type
string

getProtocol(request) → {string}

Source:
Parameters:
Name Type Description
request IncomingMessage | SGAppsServerRequest
Returns:
Type
string

getReferer(request) → {string}

Source:
Parameters:
Name Type Description
request IncomingMessage | SGAppsServerRequest
Returns:
Type
string

getRemoteIp(request) → {string}

Source:
Parameters:
Name Type Description
request IncomingMessage
Returns:
Type
string

getSize(data) → {number}

Source:
Parameters:
Name Type Description
data Buffer | string
Returns:
Type
number

getUsername(request) → {string}

Source:
Parameters:
Name Type Description
request IncomingMessage | SGAppsServerRequest
Returns:
Type
string

logRequest(request, response) → {string}

Source:

for go access: tail -c 67108864 -f '/var/logs/default/2024/2/data-master.log' | goaccess --log-format='%h %e %^[%x] "%v" "%r" %s %b "%R" "%u"' --date-format='%d/%b/%Y:%H:%M:%S %z' --time-format='%d/%b/%Y:%H:%M:%S %z' - with combined and logger %h %e %^[%x] "%r" %s %b "%R"

Parameters:
Name Type Description
request IncomingMessage
response ServerResponse
Returns:
Type
string

Type Definitions

AccessLoggerHandle(dataLog) → {null|string}

Source:
Parameters:
Name Type Description
dataLog string
Returns:
Type
null | string

AccessLoggerPath

Source:
Properties:
Name Type Attributes Default Description
isEnabled boolean <optional>
false
path string | null <optional>

file path where logs will be written, placeholders: {year} {month} {date} {day} {pid} {worker-id}

waitAllHandlers boolean <optional>
false

file path where logs will be written

handle AccessLogger.AccessLoggerHandle | null <optional>
Type:
  • object