You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl@perl.apache.org by John ORourke <jo...@o-rourke.org> on 2006/05/30 14:42:07 UTC

logging recommendations

Hi folks,

I've written a largeish (80 modules, 20k lines) mod_perl CMS and 
currently the logging is a mess.

I've looked at a few on CPAN, noteably Log::Common, but I really want 
something which:

 - allows a single, global debugging level
 - does not require each module to have access to Apache (the CMS 
modules may be called from cron jobs)

I'm thinking that something I can just 'use' in each module which has a 
BEGIN block to read its config (perhaps from httpd.conf), open the log 
files, and class methods for logging would be the neatest approach - eg:

use My::Logger qw( log );
    log($level,__PACKAGE__,$message)

Any recommendations?  Should I do something Croak-like?

If there's nothing out there I'll happily write something and share it.

cheers
John


Re: logging recommendations

Posted by John ORourke <jo...@o-rourke.org>.
Thanks to everyone who replied.  Log::Log4perl seems perfect and easy 
enough to use, especially for handling logging within a class hierarchy 
and centralised control, without having a bunch of references to pass 
around.

I'm making an Apache2:: wrapper for it so I can easily config it from 
httpd.conf.  Lovely.

John