arc444 has asked for the wisdom of the Perl Monks concerning the following question:
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");
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Log::Log4perl - changing an appenders threshold
by Anonymous Monk on Sep 07, 2017 at 11:51 UTC | |
by arc444 (Novice) on Sep 12, 2017 at 16:29 UTC |