mifflin has asked for the wisdom of the Perl Monks concerning the following question:
I know that I can have multiple configuration files and load different ones based on my application startup parameters. But I'd rather take a different approach.log4perl.rootLogger=DEBUG, Screen, FileRotate log4perl.appender.Screen=Log::Log4perl::Appender::Screen log4perl.appender.Screen.stderr=0 log4perl.appender.Screen.layout=Log::Log4perl::Layout::PatternLayout log4perl.appender.Screen.layout.ConversionPattern = %d %-1.1p %P %H %m +%n log4perl.appender.FileRotate=Log::Dispatch::FileRotate log4perl.appender.FileRotate.filename=$logFileDir/$logFileName log4perl.appender.FileRotate.mode=append log4perl.appender.FileRotate.autoflush=1 log4perl.appender.FileRotate.DatePattern=yyyy-MM-dd-HH log4perl.appender.FileRotate.layout=Log::Log4perl::Layout::PatternLayo +ut log4perl.appender.FileRotate.layout.ConversionPattern = %d %-1.1p %P % +H %m%n
Log::Log4perl::init(\$log_conf); my $log = Log::Log4perl->get_logger; if ($opt{d}) { # if starting as a daemon... # turn off the Screen appender # ?? # change the log level use Log::Log4perl::Level; $log->level($INFO); }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: How to turn off a Log4perl appender?
by ptum (Priest) on Jul 17, 2006 at 21:23 UTC | |
by saintmike (Vicar) on Jul 17, 2006 at 23:04 UTC | |
by mifflin (Curate) on Jul 18, 2006 at 01:16 UTC | |
by saintmike (Vicar) on Jul 19, 2006 at 18:18 UTC | |
by mifflin (Curate) on Jul 20, 2006 at 00:16 UTC | |
by johnmyleswhite (Initiate) on Jun 09, 2008 at 19:09 UTC | |
by Anonymous Monk on May 24, 2017 at 03:51 UTC |