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:
Directive | Description |
---|---|
%a | Client 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 credential named attribute . |
%{cookie}e | Contents of the Cookie cookie in the request. |
%{cookie}E | Contents of the Cookie cookie in the response. |
%d | Transaction identifier, or session sequence number. |
%F | Time taken to serve the request in microseconds. |
%h | Client host. |
%H | Request protocol. |
%{header}i | Contents of the Header header in the request. |
%j | The name of the resource server servicing the request. |
%J | The 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. |
%l | Client logname (RFC 1314) (default -). |
%m | Request method (i.e. GET, POST, HEAD). |
%{header}o | Contents of the Header header in the response. |
%M | The time, in Common Log Format, at which the request was received with millisecond precision. |
%p | Port over which the request was received. |
%q | The decoded query string (prepended with ? or empty). |
%Q | The raw query string (prepended with ? or empty). |
%r | First line of the request with decoded URL. |
%R | First line of the request with decoded URL including HTTP://HOSTNAME. |
%s | Response status. |
%S | The hostname of the backend server which serviced this request. |
%t | Time in Common Log Format format. |
%{format}t | The time in the given format. |
%T | Time taken to serve the request in seconds, or part thereof. |
%u | Remote user. |
%U | The URL requested. |
%v | Canonical ServerName of the server servicing the request. |
%z | The decoded path string. |
%Z | The raw path string. |
Properties
Name | Type | Constraints | Description |
---|---|---|---|
file | file | ||
format | string | Default 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
Name | Type | Constraints | Description |
---|---|---|---|
file_name | string | The 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_size | number | Minimum: 1 Maximum: unlimited Default value: 1 | The maximum size (in MB) that the file can reach before it is rolled over. |
max_rollover_files | number | Minimum: 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. |
compress | boolean | Values: 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"
Updated over 2 years ago