I have a virtualhost setup with usecanonicalname off.

I have ServerName domain.com set and ServerAlias *.domain.com in the virtualhost.

Using apache2's %v LogFormat string will only capture domain.com, and I'm trying to get it to capture foo.domain.com so I can split logs accordingly.

LogFormat I'm currently using is

LogFormat "%v %h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" vhost_combined
link|improve this question

feedback

1 Answer

Why not just stick a separate CustomLog and ErrorLog directive into each virtual host definition?

<VirtualHost *:80>
ServerAdmin webmaster@place
DocumentRoot /var/www/hosted/place/root
ServerName www.place
AddHandler cgi-script .pl
CustomLog /var/www/hosted/place/logs/access_log combined
ErrorLog /var/www/hosted/place/logs/error_log
</VirtualHost>
link|improve this answer
Because I don't want to set a new virtualhost for every subdomain we have, there's no need for it, they all share the same directives. I want to accept requests for *.foo.com in one place, but have logs that say a.foo.com, b.foo.com, c.foo.com etc. – imaginative Nov 20 '09 at 15:03
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.