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. Leo From: kumar20...@gmail.com [mailto:kumar20...@gmail.com] Sent: Sunday, August 3, 2014 4:42 PM To: dev@httpd.apache.org 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 <nikol...@kasatkina.org <mailto:nikol...@kasatkina.org> > wrote: Hi, 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. Cheers, Leo