|
From: Mike S. <m...@pe...> - 2008-10-29 20:29:16
|
On Wed, 29 Oct 2008, Erskine, Thomas (IT) wrote:
> I want to be able to define an appender in the log4perl config file,
> but not activated and then activate it programmatically However,
> Log::Log4perl->appender_by_name('SCREENDEBUG') returns undef.
>
> I guess I could add SCREENDEBUG to the log4perl.logger line and define
> it with a threshold which won't log anything and then bump the threshold
> up at runtime, but it seems wrong somehow.
An appender that's not assigned to any logger in the configuration is
ignored by Log4perl at this point -- I think that using a threshold, as
you've suggested, is a perfectly valid solution, though.
Alternatively, you can define the appender programmatically and add it
to the logger via add_appender().
-- Mike
Mike Schilli
m...@pe...
|