Custom Log Format

The configuration string of the log format is a simplified string for the servers. String can contain literal characters copied into the log files, and `%' directives which are replaced in the log file by the values as follows:

Field Name Description Field Directive Example Values

Client IP Address

IP address of the host making the request

%a

62.12.8.244

Remote Logname

Remote logname (from identd). This field is almost always null ("-")

%l

-

Authenticated User Name

Name or identifier of the authenticated user

%u

john.smith

Request Date and Time

Date and time at which the request was received by the server (in Common Log time format)

%t

[20/Jul/2010 10:07:11 +0700]

Request Date and Time

Date and time at which the request was received by the server (YYYY/Mon/DD)

%dt2

[2010/Jul/20 10:07:11 +0700]

Request Date

Date at which the request was received by the server (YYYY/Mon/DD or YYYY-Mon-DD)

%date1

2010/Jul/20 or 2010-Jul-20

Request Time

Time at which the request was received by the server

%time1

10:07:12

Request Time

Time(short) at which the request was received by the server

%time2

10:07

Request Line

Line in an HTTP request that contains the Method, Request-URI, and Protocol ending

%r

GET /www/index?query+string HTTP/1.1

Request Only

Line in an HTTP request that contains the Request-URI

%rqst

/www/index?query+string

Status Code

The server HTTP response code

%s

200, 404

Bytes Sent

Number of bytes transferred from the server to the client

%b, %B

14378

Referrer

URI of the resource (typically a web site) from which the requested URI was obtained

"%{Referer"

http://www.site.com/index.html

User Agent

Information about the browser that made the request

"%{User-Agent}i"

Mozilla/4.0 (compatible; MSIE 5.5; Windows NT 5.0)

Cookie String

Cookie name-value pairs separated by a semicolon and space character

"%{Cookie}i"

COOKIE1=value; COOKIE2=value

Client Hostname

DNS hostname of the host making the request

%h

client-123lp.domain.net

Server IP Address

IP address of the host fulfilling the request

%A

123.1.2.3

Filename

Filename of the requested URI

%f

index.html

Request Method

HTTP method of the request

%m

GET, POST

Transport Protocol

HTTP protocol version string

%H

HTTP/1.1

Server Port

Port number of the listener fulfilling the request

%p

80

Server Process ID

Identifier of the process that fulfilled the request

%P

4971

Request Stem

Stem (path) component of the requested URI

%U

/path/to/resource

Request Query String

Query component of the requested URI

%q

?page=catalog&x=100&y=0

Time to Serve

Time taken to serve the request (in seconds)

%T

0, 1, 2, 802

Server Name

Server name of the host fulfilling the request

%v, %V

server1

Any other parameter, not taken into account by analyzer

%z

   Examples of the format strings

  Apache combined:
     %h %l %u %t \"%r\" %s %b \"%{Referer}i\" \"%{User-Agent}i\"