Common Log Format

From Wikipedia, the free encyclopedia
Jump to: navigation, search

The Common Log Format, also known as the NCSA Common log format,[1] is a standardized text file format used by web servers when generating server log files. Because the format is standardized, the files may be analyzed by a variety of web analysis programs.

Each line in a file stored in the Common Log Format has the following syntax:

host ident authuser date request status bytes

Example[edit]

127.0.0.1 user-identifier frank [10/Oct/2000:13:55:36 -0700] "GET /apache_pb.gif HTTP/1.0" 200 2326

A "-" in a field indicates missing data.

  • 127.0.0.1 is the IP address of the client (remote host) which made the request to the server.
  • user-identifier is the RFC 1413 identity of the client.
  • frank is the userid of the person requesting the document.
  • [10/Oct/2000:13:55:36 -0700] is the date, time, and time zone when the server finished processing the request, by default in strftime format %d/%b/%Y:%H:%M:%S %z.
  • "GET /apache_pb.gif HTTP/1.0" is the request line from the client. The method GET, /apache_pb.gif the resource requested, and HTTP/1.0 the HTTP protocol.
  • 200 is the HTTP status code returned to the client. 2xx is a successful response, 3xx a redirection, 4xx a client error, and 5xx a server error.
  • 2326 is the size of the object returned to the client, measured in bytes.

Log files are a standard tool for computer systems developers and administrators. They record the "what happened when by whom" of the system. This information can record faults and help their diagnosis. It can identify security breaches and other computer misuse. It can be used for auditing. It can be used for accounting purposes.

The information stored is only available for later analysis if it is stored in a form that can be analysed. There are many ways to structure this data 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 may be unavailable.

See also[edit]

External links[edit]

References[edit]

  1. ^ "Log File Formats: NCSA Common". IBM. 2004-05-19. Retrieved 2013-05-07.