Apache other_vhosts_access.log和access.log日志文件

有一个奇怪的问题与Apache访问日志。 我正在获取写入该网站的条目

/var/log/apache2/access.log 

 /var/log/apache2/other_vhosts/access.log 

我正在使用Debian 6,在回购中使用最新的Apache。 当我看文件

 /etc/apache2/conf.d/other-vhosts-access-log 

它说

 # Define an access log for VirtualHosts that don't define their own logfile CustomLog ${APACHE_LOG_DIR}/other_vhosts_access.log vhost_combined 

但是当我查看我的虚拟主机声明的网站,它已经

  CustomLog ${APACHE_LOG_DIR}/access.log vhost_combined </VirtualHost> 

在文件的底部。 所以我已经声明了日志文件,那么为什么apache仍然写入一个条目到other_vhosts_access.log?

最后,我在apache / conf.d文件中注释掉了这行,但并不觉得这是最好的方法。

我错过了什么?

没有看到完整的Apacheconfiguration,这是很难诊断,但有些事情要看

  • 检查你是否在同一虚拟主机中包含或定义第二个日志文件 – 这将导致双重日志logging。
  • 检查日志文件是否互相链接 – find /var/log/apache2 -samefile /var/log/apache2/access.log将列出他们两个,如果这是真的。

考虑这是一个错误的可能性。

尝试

CustomLog $ {APACHE_LOG_DIR} /access.log合并