B Using the Custom Access-Log File Format

This appendix contains information about the log format used by Oracle® Fusion Middleware. Use these format options to customize the format of your log files. You can enter them through the Admin Console, or edit the format subelement of the access-log element in the server.xml file.

You can use variables and expressions in log formats with the syntax $variable and $(expression).

When creating a custom log format, anything between percent signs (%) is recognized as the name portion of a name-value pair stored in a parameter block in the server. Any additional text is treated as literal text, so you can add to the line to make it more readable. The one exception to the percent sign rule is the %SYSDATE% component, which delivers the current system date. %SYSDATE% is formatted using the time format %d/%b/%Y:%H:%M:%S and the offset from GMT.

If no format parameter is specified for a log file, the common log format is used:

"%Ses->client.ip% - %Req->vars.auth-user% [%SYSDATE%]
\"%Req->reqpb.clf-request%\" %Req->srvhdrs.clf-status%

Typical components of log file format are listed in the following table . Because certain components could resolve to values that contain spaces, they are enclosed in escape quotes (\").

Option Component
Client host name (unless iponly is specified in flex-log or DNS name is not available) or IP address %Ses->client.ip%
Client DNS name %Ses->client.dns%
System date %SYSDATE%
Full HTTP request line \"%Req->reqpb.clf-request%\"
Status %Req->srvhdrs.clf-status%
Response content length %Req->srvhdrs.content-length%
Response content type %Req->srvhdrs.content-type%
Referer header \"%Req->headers.referer%\"
User-agent header \"%Req->headers.user-agent%\"
HTTP method %Req->reqpb.method%
HTTP URI %Req->reqpb.uri%
HTTP query string %Req->reqpb.query%
HTTP protocol version %Req->reqpb.protocol%
Accept header %Req->headers.accept%
Date header %Req->headers.date%
If-Modified-Since header %Req->headers.if-modified-since%
Authorization header %Req->headers.authorization%
Any header value %Req->headers.headername%
Name of authorized user %Req->vars.auth-user%
Value of a cookie %Req->headers.cookie.name%
Value of any variable in Req->vars %Req->vars.varname%
Virtual server ID %vsid%
ECID %Req->vars.ecid%. For more information, refer the elements of http.
RID %Req->vars.rid%. For more information, refer the elements of http.
Duration %duration%

Records the time in microseconds the server spent handling the request. Statistics must be enabled before %duration% can be used.

System time %Time

System time in seconds since 00:00:00 UTC, January 1, 1970.

Relative time %RELATIVETIME%

System time in seconds since logging started.

Method number %Req->method_num%

A number representing the HTTP method as used in NSAPI.

HTTP Protocol Version %Req->protv_num%

A number representing the HTTP protocol version as used in NSAPI.

HTTP request line %Req->reqpb.clf-request.method%

The method from the HTTP request line.

HTTP URI %Req->reqpb.clf-request.uri%

The URI from the HTTP request line.

URI path %Req->reqpb.clf-request.uri.abs_path%

The absolute path component of the URI

URI query %Req->reqpb.clf-request.uri.query%

The query component of the URI.

user_dn %Ses->client.user_dn%

The SSL client certificate authentication for web security.

HTTP protocol %Req->reqpb.clf-request.protocol%

The protocol from the HTTP request line.

Protocol name %Req->reqpb.clf-request.protocol.name%

The name of the protocol.

Protocol version %Req->reqpb.clf-request.protocol.version%

The version of the protocol.

Origin server %Req->vars.origin-server%

The origin server that served the request.

Cache Finish Statuses in Access Logs %Req->vars.proxy-cache-finish-status%
Cache status of the origin servers response in the proxy server

Additional log file parameters that can be configured are listed in the table below.

Option Component
Cipher name %Ses->client.cipher%
Size in bits of cipher key %Ses->client.keysize%
Size in bits of private key %Ses->client.secret-keysize%
DN for certificate issuer %Ses->client.issuer_dn%
DN for certificate user %Ses->client.user_dn%
SSL session identifier %Ses->client.ssl-id%