Request Log

logging/request_log

Defines and enables request logging.

Log Format

The following directives can be added to the format property to customize the log format:

DirectiveDescription
%aClient IP Address.
%ALocal IP Address.
%bBytes in the response excluding HTTP headers in CLF format: - instead of 0 when no bytes are returned.
%BBytes in the response excluding HTTP headers.
%{attribute}CAttribute from the credential named attribute.
%{cookie}eContents of the Cookie cookie in the request.
%{cookie}EContents of the Cookie cookie in the response.
%dTransaction identifier, or session sequence number.
%FTime taken to serve the request in microseconds.
%hClient host.
%HRequest protocol.
%{header}iContents of the Header header in the request.
%jThe name of the resource server servicing the request.
%JThe length of time, in microseconds, that the resource server server spent processing the request. This will include 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.
%lClient logname (RFC 1314) (default -).
%mRequest method (i.e. GET, POST, HEAD).
%{header}oContents of the Header header in the response.
%MThe time, in Common Log Format, at which the request was received with millisecond precision.
%pPort over which the request was received.
%qThe decoded query string (prepended with ? or empty).
%QThe raw query string (prepended with ? or empty).
%rFirst line of the request with decoded URL.
%RFirst line of the request with decoded URL including HTTP://HOSTNAME.
%sResponse status.
%SThe hostname of the backend server which serviced this request.
%tTime in Common Log Format format.
%{format}tThe time in the given format.
%TTime taken to serve the request in seconds, or part thereof.
%uRemote user.
%UThe URL requested.
%vCanonical ServerName of the server servicing the request.
%zThe decoded path string.
%ZThe raw path string.

Properties

NameTypeConstraintsDescription
filefile
formatstringDefault value: "%h %u %t %r %s %b"The format of the events written to the request log. See the Log Format table above for the available directives.

logging/request_log/file

By default the request log events will be written to the console of the container. By setting the file configuration the request log events can instead be written to a local file.

Properties

NameTypeConstraintsDescription
file_namestringThe name of the generated log file. If the file name is supplied without any path information the file will be written to the /var/iag/logs directory. If the file name contains path information the hosting directory must be created and available before the container is started.
max_file_sizenumberMinimum: 1

Maximum: unlimited

Default value: 1
The maximum size (in MB) that the file can reach before it is rolled over.
max_rollover_filesnumberMinimum: 1

Maximum: unlimited

Default value: 1
The maximum number of rollover files to be kept on disk. When the number of rollover log files reaches the specified threshold, the oldest log file is deleted.
compressbooleanValues: true or false

Default value: true
A boolean which indicates whether rolled over log files should be automatically compressed to conserve disk space.

Example

logging:
  request_log:
    file:
      file_name: request.log
    format: "%t %a %R"