httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Leo Nikolaev" <>
Subject RE: Error log vhost addition
Date Sun, 03 Aug 2014 12:45:41 GMT
There is no separate vhost configuration, when you use mod_vhost_alias and VirtualDocumentRoot
– their goal to make *one* configuration file for all the virtual hosts and add new virtual
host by just creating a directory to hold it.


And Apache needs to open log files at start up, so ErrorLog should be strictly defined at
this point, e.g. at start. In mod_vhost_alias you don’t know at start which vhosts you will
be serving.




From: [] 
Sent: Sunday, August 3, 2014 4:42 PM
Subject: Re: Error log vhost addition


you can define error log separately per vhost inside the vhost configuration 


On Sun, Aug 3, 2014 at 5:30 PM, Leo Nikolaev < <>
> wrote:



I’d like to propose a small patch to the error log routines.


Here is the abstract. A lot of ISP’s and other hosting providers use mod_vhost_alias and
VirtualDocumentRoot directive to provide effective configuration of virtual hosts.


The problem comes in, when you would like to provide separate log per virtual host. With access
log it could be easily done via log pipe: we can add %v variable and pass it along to some
script or application, which will put the log line to virtual host log file.


But error log is more tricky – there is no information about virtual host at all, so error
log piping gives no ability to understand the vhost, which caused the error.


Sure, information in error log is not always connected to any virtual host, it could be just
some information like “Whoa, I’ve just started” or smth else. But there is a code, which
checks whether there is request or even connection (lines 912 and 918 in log.c)


So will it be reasonable to add [vhost: %s] section to error log string? Of we have info->r,
we have the Host header value or host name for sure there.








View raw message