[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: [cgiapp] Anyone using Log4perl?


> From: news [mailto:suppressed On Behalf Of Robert Hicks
> Sent: Tuesday, 14 November 2006 8:38 a.m.
> To: suppressed
> Subject: [cgiapp] Anyone using Log4perl?
> 
> I was wondering if anyone is either working on a Log4perl plugin or is
> currently using it in CA with a simple pre-run wrapper.
> 

You could try something like in your base class:

sub logger {
    my $self = shift;
    unless ($self->{__MYAPP_LOGGER}) {
        Log::Log4perl::init_and_watch($self->conf->param('cms_logger_conf'),
            30);
        $self->{__MYAPP_LOGGER} = get_logger("cms");
    }
    return $self->{__MYAPP_LOGGER};
}


And then test with something like this in your code:

$self->logger->debug('Test message');

Dan


---------------------------------------------------------------------
Web Archive:  http://www.mail-archive.com/suppressed/
              http://marc.theaimsgroup.com/?l=cgiapp&r=1&w=2
To unsubscribe, e-mail: suppressed
For additional commands, e-mail: suppressed


Mail converted by mhonarc 2.6.15
This archive provided courtesy of JSW4.NET, Internet Hosting Services for Small Business.