You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl@perl.apache.org by James G Smith <JG...@TAMU.Edu> on 2002/02/12 08:07:58 UTC

Re: About PerlLogHandler phase

"Randy J. Ray" <rj...@redhat.com> wrote:
>* If I install a handler for PerlLogHandler, does the normal logging still
>  take place? Is it a function of whether my handler returns OK, DECLINED,
>  etc.?

Not sure -- anyone want to play around a bit?

>* Are there ways to register other log types, in addition to the access,
>  error, etc.? Such that people could specify those (and a format) the
>  same way they specify the others? More to the point, so that there
>  might be a ready file-descriptor I could print to, rather than having to
>  deal with the open/lock/write/unlock/close cycle.

Not in Apache 1.3, afaik, and probably not in 2.0.  Part of it has to
do with how STDERR is handled - being sent to the error log.  Apache
only handles two log file descriptors afaik. (well, kinda - two per
virtual server)

You should be able to open the file at server startup/configuration
and then write to it during the logging phase, closing it at child
exit time.  This mirrors how Apache does it, except you'll need to do
it all in Perl.

I'm doing something similar to help me debug stuff since Apache
doesn't open log files until after it reads the configuration file
once.  I haven't run into any problems.  You'll probably want to set
autoflush to true so Perl writes the text immediately.

Hmm... /me smells an Apache::Logger module... (or something with a
similar name).
-- 
James Smith <JG...@TAMU.Edu>, 979-862-3725
Texas A&M CIS Operating Systems Group, Unix

Re: About PerlLogHandler phase

Posted by Ged Haywood <ge...@www2.jubileegroup.co.uk>.
Hi there,

On Tue, 12 Feb 2002, James G Smith wrote:

> "Randy J. Ray" <rj...@redhat.com> wrote:
> 
> >* Are there ways to register other log types, in addition to the access,
> >  error, etc.? Such that people could specify those (and a format) the
> >  same way they specify the others? More to the point, so that there
> >  might be a ready file-descriptor I could print to, rather than having to
> >  deal with the open/lock/write/unlock/close cycle.

You can pipe all logs to your own scripts/executables/whatever and do
what you like with them, or use syslog if you're on *x and into that
kind of pain.  It's in the doc's.

73,
Ged.