Sun Java System Web Server 7.0 Update 3 Administrator's Configuration File Reference

Custom Log File Format

When creating a custom log format, anything contained 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 plus 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%
%Req->srvhdrs.content-length%"

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 escaped quotes (\").

Table C–1 Typical Components of Custom Log Formatting

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%

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.