"Catch-All" access log with Apache Virtual Hosts?

Posted by pix0r on Server Fault See other posts from Server Fault or by pix0r
Published on 2009-10-13T01:01:40Z Indexed on 2010/04/02 20:03 UTC
Read the original article Hit count: 368

Filed under:
|
|

I have many virtual hosts set up on a web server, each one having its own error and access log. The relevant lines of httpd.conf are something like this:

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

Currently, I'm getting some random errors in /var/log/httpd-error.log, but I'm getting nothing in /var/log/httpd-access.log. Is it possible to have ALL accesses and errors duplicated to a shared logfile? Is it possible to do this without adding new entries to every single VirtualHost?

© Server Fault or respective owner

Related posts about apache

Related posts about virtualhosts