Apache other_vhosts_access.log and access.log log files

14,920

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.

Share:
14,920

Related videos on Youtube

Wizzard
Author by

Wizzard

Updated on September 18, 2022

Comments

  • Wizzard
    Wizzard over 1 year

    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?

  • Jenny D
    Jenny D about 11 years
    That's not an answer to the question.
  • alexg
    alexg about 8 years
    Your comment is not a downvote to the non-answer to the question
  • Law29
    Law29 almost 8 years
    I don't see how changing the logging format for a less precise one can make a difference. Apache docs clearly specify If CustomLog or ErrorLog directives are placed inside a <VirtualHost> section, all requests or errors for that virtual host will be logged only to the specified file. Any virtual host which does not have logging directives will still have its requests sent to the main server logs.