Dan Horne wrote:
From: news [mailto:[EMAIL PROTECTED] On Behalf Of Robert Hicks
Sent: Tuesday, 14 November 2006 8:38 a.m.
To: cgiapp@lists.erlbaum.net
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/cgiapp@lists.erlbaum.net/
             http://marc.theaimsgroup.com/?l=cgiapp&r=1&w=2
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to