我在Web服务器上设置了许多虚拟主机,每个虚拟主机都有自己的错误和访问日志。相关行httpd.conf
如下所示:
ErrorLog /var/log/httpd-error.log
LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
CustomLog /var/log/httpd-access.log combined
NameVirtualHost *:80
<VirtualHost *:80>
ServerName myhost.com
ServerAlias www.myhost.com
DocumentRoot /var/www/myhost.com/htdocs
ErrorLog /var/www/myhost.com/log/error.log
CustomLog /var/www/myhost.com/log/access.log combined
</VirtualHost>
# ... many more VirtualHosts
目前,我在/var/log/httpd-error.log中遇到一些随机错误,但在/var/log/httpd-access.log中却没有得到任何错误。是否可以将所有访问和错误复制到共享日志文件?是否可以在不向每个VirtualHost添加新条目的情况下执行此操作?