Apache other_vhosts_access.log and access.log log files
Got a weird issue with the apache access logs. I am getting an entry for the site written to
/var/log/apache2/access.log
AND
/var/log/apache2/other_vhosts/access.log
I am using Debian 6, with the latest Apache in the repo. When I look at the file
/etc/apache2/conf.d/other-vhosts-access-log
It says
# Define an access log for VirtualHosts that don't define their own logfile
CustomLog ${APACHE_LOG_DIR}/other_vhosts_access.log vhost_combined
but when I look in my VirtualHost declaration for the site, it has
CustomLog ${APACHE_LOG_DIR}/access.log vhost_combined
</VirtualHost>
at the bottom of the file. So I have declared the log file, so why does apache still write an entry to the other_vhosts_access.log?
In the end, I commented out the line in the apache/conf.d file, but doesn't feel like it's the best way.
What am I missing?
Solution 1:
Without seeing the full apache configuration this is difficult to diagnose but some things to look at
- Check that you're not including or defining a second log file within the same vhost - this will cause double logging.
- Check that the log files aren't linked to each other -
find /var/log/apache2 -samefile /var/log/apache2/access.log
will list them both if this is true.
Consider the possibility that this is a bug.