The structure of Apache Server Log

May 30, 2017 - Linux

Apache2 server log is located at /var/log/apache2/access.log.

It displays entries like: - - [30/May/2017:11:36:50 +0200] "GET /wprestapi/wp-content/themes/twentyseventeen/assets/js/skip-link-focus-fix.js?ver=1.0 HTTP/1.1" 200 931 "http://localhost/wprestapi/sample-page/" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:53.0) Gecko/20100101 Firefox/53.0"

The format of the log is defined in /etc/apache2/apache2.conf

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

In /etc/apache2/sites-enabled/____.conf is defined which format is used for a particular page.

ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined

There is also an error log located at /var/log/apache2/error.log.