Different Apache log file for each subdomain?

Posted by consolibyte on Server Fault See other posts from Server Fault or by consolibyte
Published on 2010-03-24T15:42:45Z Indexed on 2010/03/24 15:53 UTC
Read the original article Hit count: 334

Filed under:
|

Is it possible to configure Apache to use a different log file for each subdomain, even if all of the subdomains are within the same VirtualHost container?

So, I have only one VirtualHost:

<VirtualHost *:80>
  ServerName example.com
  ServerAlias test1.example.com test2.example.com test3.example.com
</VirtualHost>

And I want to end up with the following log files:

/var/log/httpd-access_test1.log
/var/log/httpd-access_test2.log
/var/log/httpd-access_test3.log

I know I can probably do this with a custom log format and split-logs, but I was wondering if there's a way to just have Apache do it for me.

© Server Fault or respective owner

Related posts about apache

Related posts about logging