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

[cgiapp] Re: Anyone using Log4perl?


Dan Horne wrote:
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


When you say "base class" I assume you mean (or think) I am creating a plugin? I was hoping to just use it and make it more CA like. I guess I could try my hand at a plugin for it.

Robert


---------------------------------------------------------------------
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.