Log file format tokens
This topic provides information about tokens used to define log file formats.
Token | Description |
---|---|
|
The remote client IP address. Example: 192.168.1.3 |
|
The local client IP address. Example: 192.168.1.3 |
|
The number of bytes transmitted, excluding HTTP headers in common log format. Example: - = no bytes transmitted |
|
The number of bytes transmitted, excluding HTTP headers in extended log format. Example: 0 = no bytes transmitted |
|
The contents of the environment variable named var. |
|
The requested file name. Example: /www/index.htm |
|
The remote host name or IP address. Example: hal.ibm.com or 192.168.1.3 |
|
The requested protocol. |
|
The contents of the HTTP header line named var. Example: %{User-agent}i = Mozilla/4.5 [en] (WinNT; U) |
|
The remote logname. |
|
The request method. |
|
The contents of the note named var. |
|
The contents of the header lines named var in the reply. |
|
The canonical Port of the server serving the request. Example: 80 |
|
The process ID that serviced the request. Example: 837 |
|
The query string (or search argument) prepended with a "?". Example: ?name=hal |
|
The first line of the request. Example: GET / HTTP/1.0 |
|
The server response status. Example: 200 |
|
The time in common log format. Example: [21/Mar/2000:14:08:03 -0600] |
|
The time in strftime format. |
|
The time (in seconds) taken to serve the request. Example: 1 |
|
The name of the authenticated remote user. Example: hal |
|
The requested URL path. Example: / |
|
The canonical server name of the server serving the request. |
|
The server name according to the UseCanonicalName setting. |
Note:
- Logformat %D is not supported.
- The "..." can be replaced with a condition for inclusion or it
can be omitted. The character < determines if the original value
is logged. The greater than character (>) determines if the redirected
value is logged. The condition may be preceded by a ! to reverse the
condition. For example:
Condition Description %>s
Logs the returned status. %{User-agent}i
Logs User-agent on all requests. %400,501{User-agent}i
Logs User-agent only when a 400® error (Bad Request) or a 501 error (Not Implemented) is encountered. %!200,304,302{Referer}i
Logs Referer on all requests which did not return some sort of normal status.