From: Tony B. <log...@tm...> - 2004-01-10 01:17:52
|
On Fri, Jan 09, 2004 at 10:14:33AM -0800, Mike Schilli wrote: > init() (or easy_init()) should be called exactly once, when the > application starts up. If you're running a typical CGI-Skript, running > it per request is fine. However, in a persistent environment (like > mod_perl), calling init() (or easy_init()) per request is not > recommended ... If you want to reset its level in the new() > call, just do something like ... $logger->level($ERROR); Aha. That makes sense. I think this should be made much clearer in the docs. It's quite an important philosophical point about how the package is used that probably differs quite significantly from how many people's home-grown approaches would have worked. Switching my method in new() from Log::Log4perl->easy_init($args->{DEBUG} ? $DEBUG : $ERROR); to get_logger->level($args->{DEBUG} ? $DEBUG : $ERROR); seems to do the trick in my simple test. I'll try plugging this approach into the real application tomorrow. Thanks, Tony |