access.log not logging messages in apache2

Suresh picture Suresh · Oct 11, 2013 · Viewed 8.6k times · Source

I seeing a weird behaviour in access.log logging by apache2. Only the first 2 requests from the same client are logged but not after that.

The Virtualhost config file is having this setting:

CustomLog ${APACHE_LOG_DIR}/access.log combined

Can anyone please tell me What else need to be set in apache2 to get access log working correctly ?

Answer

Reed picture Reed · Oct 11, 2013

Try without ${APACHE_LOG_DIR} variable with full path to logfile.

Example (Linux):

CustomLog /var/log/apache2/access.log combined

You can try without full path too:

CustomLog logs/access.log combined

It creates access.log in logs/access.log file in Apache home directory.

Make sure directory is exists and check permissions.