Customize the HTTP request log
We can customize the content of the request.log file by adding a configuration entry in the [logging] stanza. The syntax is as follows:
request.log-format=directives
The following directives can be used to customize the log format:
Directive Description %a Remote IP address %A Local IP address %b Bytes in the response excluding HTTP headers in CLF format: '-' instead of 0 when no bytes are returned %B Bytes in the response excluding HTTP headers %{Attribute}C Attribute from the ISAM credential named 'Attribute' %d Transaction identifier, or session sequence number %F Time that it takes to serve the request in microseconds %h Remote host %H Request protocol %{header-name}i Contents of the Header 'header-name' in the request %j The name of the junction that services the request %J The length of time, in microseconds, the junction server spent processing the request. This includes the time that it took to send the request to the server, the length of time that it took the server to process the request, and the length of time that it took to read and process the response header. %l Remote logname %m Request method (that is, GET, POST, HEAD) %{header-name}o Contents of the Header 'header-name' in the response %p Port over which the request was received %q The query string (prefixed with '?' or empty) %Q Raw query strings that must be decoded manually. %r First line of the request %R First line of the request including HTTP://HOSTNAME %s Response status %t Time and date in CLF format %{format}t The time and date in the specified format %T Time that it takes to serve the request in seconds %u Remote user %U The URL requested %v Canonical ServerName of the server that serves the request %{cookie-name}e Contents of the cookie 'cookie-name' in the request %{cookie-name}E Contents of the cookie 'cookie-name' in the response The following configuration entry shows an example of customizing the request.log file:
request.log-format = %h %l %u %t "%r" %s %bCustomized HTTP logs also support the new line (\n), carriage return (\r), and tab (\t) special characters. Any character that is either not part of a directive or not a special character is written out in the log entry. We can direct the system to ignore the % and \ characters by prefixing them with the backslash (\) character. For example:
request.log-format = \%{header}i\t->\t%{header}irenders the following output:%{header}i -> header
Parent topic: WebSEAL HTTP logging