You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by Alasdair Lumsden <al...@alivewww.com> on 2003/05/23 15:46:32 UTC

ErrorLog/VirtualHost Modification

Hello,

First of all I apologise profusely if this has been sent to the wrong
list. I have mentioned this problem on users- but really it is more of a
development issue than a users issue.

I'm not a programmer myself, otherwise I would commit the time to
writing a patch. Since this is in many ways a feature request, if anyone
could point out a more appropriate place I should make it, please let me
know.

I do however feel this is worthy of some attention as it is a simple
problem that causes large headaches.

At present if you wish to have detailed logging for each VirtualHost,
you have to have a separate ErrorLog and AccessLog per VirtualHost. On a
site hosting a large number of VirtualHosts, this results in hundreds if
not thousands of file descriptors being used, and becomes a log rotation
nightmare.

This is easily solved for the AccessLog by using CustomLog and appending
the virtualhost servername to the log, using %v. You can then have one
log that you can process, rather than several hundred or thousand. (In
my case, this gets piped of to pglogd, and stuck in a Postgres database
- accounting per virtualhost becomes trivial).

There is however, no way (that I know of) to do this for the ErrorLog.
If you want to log the errors for each VirtualHost, you still need to
maintain a separate error_log file per VirtualHost.

I propose a "CustomErrorLog" directive - or perhaps a "VirtualErrorLog"
directive, or some way to append the virtualhost servername to each
ErrorLog entry, so that one can use a single ErrorLog directive in the
main configuration, and simply process that logfile.

On installations where it is necessary to give customers access to their
ErrorLogs for debugging, Admins look for the least cost solution. Having
one ErrorLog where you can differentiate which VirtualHost the error
came from, rather than having several thousand separate ErrorLogs, is
obviously preferable.

If anyone is interested in writing a "quick dirty patch" that simply
prepends the virtualhost server name to each ErrorLog entry, myself and
many others would be grateful. If money is motivation, then I may be
willing to pay a developer to do this - contact me off list if
interested.

I feel such a modification would greatly benefit the Apache community.

Again, I'd like to apologise if this is wholly inappropriate for this
list, and if anyone could direct me to a more appropriate place to
discuss this, please do.

Yours sincerely,

Alasdair Lumsden