This is more of a users question.

Just write a little program (C, perl, python, wahetevr) to be used as a piped 
logger and have it split the lines as they are logged.  Just log the virtual 
host first (%V, I think) and use that to split it).  You only have to have one 
logger running/open.


-----Original Message-----
From: Alain Williams [mailto:[EMAIL PROTECTED]
Sent: Mon 5/15/2006 7:05 AM
To: dev@httpd.apache.org
Subject: CustomLog suggestion
 
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  http://www.phcomp.co.uk/

#include <std_disclaimer.h>

<<winmail.dat>>

Reply via email to