Common Log Format
For computer log management, the Common Log Format, also known as the NCSA Common log format, is a standardized text file format used by web servers when generating server log files. Because the format is standardized, the files can be readily analyzed by a variety of web analysis programs, for example Webalizer and Analog.
Each line in a file stored in the Common Log Format has the following syntax:
host ident authuser timestamp request-line status bytes
The format is extended by the Combined Log Format with referer and user-agent fields.
Example
127.0.0.1 ident alice "GET /index.html HTTP/1.1" 200 9481A field set to dash indicates missing data.
- is the IP address of the client which made the request to the server.
- is the RFC 1413 identity of the client, if supplied.
- is the userid of the person requesting the document. Missing unless HTTP authentication is used.
- is the request timestamp. Here in strftime format.
- is the request line from the client. The method, the resource requested, and the HTTP protocol version.
- is the HTTP status code returned to the client.
- is the response size, in bytes.
Usage
The information stored is only available for later analysis if it is stored in a form that can be analysed. This data can be structured in many ways for analysis. For example, storing it in a relational database would force the data into a query-able format. However, it would also make it more difficult to retrieve if the computer crashed, and logging would not be available unless the database was available. A plain text format minimises dependencies on other system processes, and assists logging at all phases of computer operation, including start-up and shut-down, where such processes might be unavailable.