Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"

Re^2: Log::Log4Perl best practices

by water (Deacon)
on Jun 03, 2004 at 10:25 UTC ( [id://360039]=note: print w/replies, xml ) Need Help??

in reply to Re: Log::Log4Perl best practices
in thread Log::Log4Perl best practices

If the modules use stealth logging,
package MyPackage; use Log::Log4perl qw(:easy); sub method { DEBUG "Doing something!"; }
How does the main driver turn debugging on an off?
use Log::Log4perl qw(:levels); Log::Log4perl->init("/home/mycode/log4perl-conf.txt"); my $logger = Log::Log4perl->get_logger; $logger->level($DEBUG);
is not "seen" by the module.

Or am I just not getting it by trying to set levels in my code, rather than in the conf file? I don't envision using the 'change logging level while code is running' feature, and it seems more direct to me to set the log level in the code, rather than in the conf file. I'm really just using the conf file for appender & filter specification, it seems.

Thanks for any clarification. Mike, your advice has been great, thanks.

Log In?

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://360039]
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others imbibing at the Monastery: (7)
As of 2024-04-22 22:17 GMT
Find Nodes?
    Voting Booth?

    No recent polls found