Hi,

Wed, Jul 16, 2003 at 11:07:47AM +0100: Jez Hancock wrote:
> Hi Ged,
> 
> On Wed, Jul 16, 2003 at 07:06:43AM +0100, Ged Haywood wrote:
> > On Tue, 15 Jul 2003, Jez Hancock wrote:
> > > Does anyone how one could log errorlog entries in a similar manner to
> > > the script above - ie pipe the errorlog to a script which appends one
> > > copy of the error entry to a main error logfile and another copy to the
> > > virtual host's error logfile?
> > It's possible, but I don't think you really want to do it.  You would
> > be asking the server to do more than is necessary while handling each
> > request (you probably already are:).
> This was my reason for considering using mod_perl :)
> 
> > Would it not be better for example to rotate your logs frequently, and
> > to process them afterwards, off-line?  You would then have a choice of
> > doing things with the various log file analysis tools too.  If you are
> > a little bit creative in what you log, it can be simple to extract the
> > information you need for each vhost from one file.
> I would do this but we wanted to give our users 'live' logfiles, rather
> than making them wait until log rotation before being able to view them
> (or did I misunderstand you?).

During my work on the ENodes project, i've developed a tiny threaded logger
in c to manage internal logfiles (by webmaster/website/version).
(you can rewrite it in perl with a 5.8.x built with thread...)

Perl handlers send log lines through a UNIX socket to the logger which
is opening logfiles when needed and keeping them opened.
It avoids the overhead of opening and locking each time the file and
provides as many online debug logfile as you ask.
The logger is launched in a 'PerlRequire' file.
The client have a persistant connection to the logger.

If it fits your needs, you can get sources here: http://www.enodes.org
 Server         : utils/enodes_logger/enodes_logger.c
 Client module  : enodes_core/modules/ENodes/Core/ApLog.pm

Cheers
--
Guillaume FOUGNIES

Reply via email to