Peculiarities of Apache Log Formats

Fulfilling web application testing, the specialists should be well acquainted with the peculiarities of the server performance.

Logs provide the detailed information which helps to reveal the common server’s problems. But for creating the access log, it needs to have the mod_log_config module available.

There are three directories in the configuration file:

  • TransferLog - for creating a log file;
  • LogFormat - for creating user format;
  • CustomLog - for creating and formatting the log file.


There are also certain types of log formats.

2 types of the Apache log formats:

  • Common log format

LogFormat "%h %l %u %t \"%r\" %>s %b" common

CustomLog logs/access_log common

  • Combined format

LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-agent}i\"" combined

CustomLog log/access_log combined

In order to make the formats available, it is required to edit the Apache configuration file.

What are log’s components?

  • %h - remote host.
  • %1 - user ID.
  • %u - user name, defined by HTTP authentication.
  • %t - time, the server will complete the request processing.
  • %r - client query string.
  • %> - state code, sent to the user from the server.
  • %b - client response size in the bytes.
  • Referer - page, attached to this URL.
  • User-agent - browser ID string.

Having figured out well with the Apache web server peculiarities, the specialists will be able to easily execute server side testing, configuration checking, functional testing, load control, system testing, automated or manual testing.