Introduction
The Common Log Format is the line format of web server access logs. It came from the NCSA web server and was kept by the Apache HTTP Server, and it is still what Apache and nginx write by default, usually in its extended form, the Combined Log Format. Each line records one request: who made it, when, what was asked for and how the server answered.
The files are usually called access.log or access_log, under
/var/log/apache2, /var/log/httpd or
/var/log/nginx. Many analysis tools read them directly.
Structure
A Common Log Format line has seven fields separated by spaces: the client’s address, the identity from identd, the signed-in user name, the time in square brackets, the request line in double quotes, the status code and the size of the response in bytes. A field with no value is written as a hyphen.
The Combined Log Format adds two more quoted fields at the end: the referring page and the browser’s User-Agent string. Servers can be set to log other fields, so a particular file may carry more.
127.0.0.1 - frank [10/Oct/2000:13:55:36 -0700] "GET /apache_pb.gif HTTP/1.0" 200 2326
Also used for
- Plain text log .log
- W3C Extended Log File Format .log
Links
Software
- Apache HTTP Server, which writes these logs (Linux, Windows, Unix)
- nginx, which writes the combined format by default (Linux, Windows, Unix)
- GoAccess, a log analyser for the terminal and the browser (Linux, macOS)
- AWStats, a web log analyser (Linux, Windows)
Reference
- mod_log_config, the Apache documentation of the log formats and their fields