Hi. Im trying to change the thresold on an appender, but without success. Why do I want to do this ? - it would be in response to a '-debug' option provided to the script ( not shown for clarity ) Minimal case example of the issue is shown below. Suggestions very gladly welcomed Thank you.
#!/usr/bin/perl use strict; use warnings; use Log::Log4perl; my $log4p_conf = q( log4perl.rootLogger=DEBUG, SCREEN log4perl.appender.SCREEN=Log::Log4perl::Appender::Screen log4perl.appender.SCREEN.layout=SimpleLayout log4perl.appender.SCREEN.Threshold=INFO ); Log::Log4perl->init(\$log4p_conf); my $log = Log::Log4perl->get_logger(""); # This appears to have no effect : Log::Log4perl->appender_by_name('SCREEN')->threshold('DEBUG'); $log->fatal("fatal msg"); $log->error("error msg"); $log->warn("warn msg"); $log->info("info msg"); $log->debug("debug msg"); $log->trace("trace msg");
In reply to Log::Log4perl - changing an appenders threshold by arc444
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |