httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alain Williams <>
Subject CustomLog suggestion
Date Mon, 15 May 2006 11:05:21 GMT
I have a suggestion that may be a useful enhancement to CustomLog.

Background: the number of virtual hosts that I have is increasing, some of
them are for other people - several have several virtual hosts. I want them
to have access to the log information that relates to their sites and not be
confused with stuff for others.

So what I do is to have every virtual host have it's own set of log files,
as pointed out this does not scale too far. The suggestion is to log to one
place and split the log file daily/... The trouble with this is that it makes
debugging individual vhosts slow (wait 'till the log file is split), or I need
to split continuously.

Suggestion: If a CustomLog directive specifies a log file/pipe that is already
open (eg for some other vhost) then it should share/reuse the file descriptor.
This would allow separate log files to scale a little further.

I tried to do this but find that apache just opens the log file several times.

Looking at mod_log_config.c I see that buffered_log has a mutex that controls
different threads writing to the same log file (what I thought would be the
main issue), what needs to be added is

* some reference count as to how often the file is open in config_log_state

* logic in ap_default_log_writer_init to check if 'name' is already used

Comments ?

Alain Williams
Parliament Hill Computers Ltd.
Linux Consultant - Mail systems, Web sites, Networking, Programmer, IT Lecturer.
+44 (0) 787 668 0256

#include <std_disclaimer.h>

View raw message