Custom log file format

When a request is processed, we can create rule sets to specify what data to include in the logs, the display order, the conditional logic for filtering which requests are included, and the log file number and names.


Custom property objects

Custom property objects can be used at the rule set, rule, and action level. Rules determine the conditions based upon which log actions are executed. An expression field is used to determine the requests and responses to log. This expression uses the standard HTTP language operands, and the response.code operand to filter by HTTP response codes, such as 404, or 503. For example, response.code = 200 filters all responses for response code 200. The HTTP operand targetserver is used to show the server where the request was sent in a WAS format. The HTTP custom log operand service.time is the time frame between when the request is sent to the application server, and when a response is received from the application server. The HTTP custom log operand response.time is the time frame between when the request is received in the ODR , and when the request response is sent from the ODR. For more information, read about HTTP custom log operands.

The rule priority determines the order of the rule evaluation. Specific log actions occur when rules are matched. The log actions have a continue field. When continue is set to true, subsequent log actions can be executed. However, if continue is set to false, once the log action is finished, no subsequent log actions are performed. Use the manageODR.py script to create a cluster of ODRs and to manage custom logging. For more information, read about the manageODR.py script.


ruleset

name

Name of the rule set. (String, required)

type

Type of rule set. (String, protocol identifier such as HTTP)

continueDefault

Determines the default value for continue. (Boolean, required)

properties

Optional

rule

Required


rule

name

Name of the rule. (String, unique within ruleset)

priority

Required, integer (unique within ruleset)

expression

String, required.

action

Required.

properties

Optional


Action

name

Name of the action. (String, unique within rule)

priority

Optional, integer (unique within rule).

type

String, required, log

value

Required.(String, contains a series of logFormats delimited by @. For example:

    value="custom01.log %a%z@custom02.log @(#) 10 1.7@(#)Z"

continue

Optional, boolean. If not set, defaults to continueDefault value; true, false.

properties

Optional


customProperties

name

Name custom property. (String)

value

Required.(String)

continue

Optional, boolean. If not set, defaults to continueDefault value; true, false.


Log action format

The action value attribute contains a set of arguments to indicate the file name and format of the log. To create multiple logs in the value attribute, delimit the arguments with a @. The first argument for the log action is the name of the log file, relative to the ODR logs directory. The following arguments are parameters to specify what information to place into the log. The data is shown in the order in which the parameters are specified.

Parameter Description
%a Remote IP address.
%A Local IP - address.
%B Bytes sent, excluding HTTP headers.
%b Bytes sent, excluding HTTP headers. In CLF format, that is, a '-' rather than a zero when no bytes are sent.
%{FOOBAR}C The contents of the cookie in the request sent to the server.
%{FOOBAR}i The contents of Foobar: header lines in the request sent to the server.
% I Bytes received, including request and headers, cannot be zero.
%{FOOBAR}e The contents of the debug argument ("-D") FOOBAR specified for the JVM of the ODR process.
%h Remote host.
%H The request protocol HTTP or HTTPS.
%m The request method.
%{FOOBAR}o The contents of Foobar, header lines in the reply.
%O Bytes sent, including headers; the number cannot be zero.
%p The canonical port of the server serving the request.
%q The query string, with ? prefix, if a query string exists. Otherwise, it is an empty string.
%r First line of request.
%R Response time in milliseconds. Combined time spent in ODR and application server.
%s Status, HTTP response code, that is, 503, 404, 200.
%t Time, in common log format time format, standard English format.
%{format}t The time, in the form given by format, which should be in strftime(3) format. Potentially localized.
%T The time taken to serve the request, in milliseconds.
%U The URL path requested, not including any query string.
%v The canonical ServerName of the server serving the request.
%z Destination IP address.
%Z Destination server name (cell/node/server).


Related tasks

  • Configure custom logs

  • manageODR.py script
  • Intelligent Management: HTTP operands