I have a webserver with many (thousands) VirtualHosts. With the current configuration, Apache fills 2 files for each VirtualHost: error.log + access.log. Apache works in prefork mode and to avoid to many file descriptors opened at the same time, I would like to have a single access.log and error.log for all VirtualHosts.
A CRON task will split files for each VirtualHost once a day, so I need the VirtualHost name on each line of the *.log files. This is pretty easy for access.log:
LogFormat "%V:%p %h %l %u %t \"%r\" %>s %O \"%{Referer}i\" \"%{User-Agent}i\"" vhost_combined
CustomLog /var/log/apache2/vhosts_access.log vhost_combined
%V gives me the VirtualHost name and that's enough for splitting files.
But I just can't find the equivalent setting for ErrorLog.
Questions:
- in your opinion is it relevant to try to identify each the origin of each error.log line
- do you know a solution?