# start using log4perl via a config file dispatcher Log::Log4perl => 'logger' , accept => 'NOTICE-' , config => "$ENV{HOME}/.log.conf"; # disable default dispatcher dispatcher close => 'logger'; # configuration inline, not in file: adapted from the Log4perl manpage my $name = 'logger'; my $outfile = '/tmp/a.log'; my $config = <<__CONFIG; log4perl.category.$name = INFO, Logfile log4perl.appender.Logfile = Log::Log4perl::Appender::File log4perl.appender.Logfile.filename = $outfn log4perl.appender.Logfile.layout = Log::Log4perl::Layout::PatternLayout log4perl.appender.Logfile.layout.ConversionPattern = %d %F{1} %L> %m __CONFIG dispatcher 'Log::Log4perl' => $name, config => \$config;
See SYNOPSIS in Log::Report::Dispatcher
This dispatchers produces output tot syslog, based on the Sys::Log4perl
module (which will not be automatically installed for you).
The REASONs for a message in Log::Report are names quite similar to the log-levels used by Log::Log4perl. The default mapping is list below. You can change the mapping using new(to_level).
TRACE => $DEBUG ERROR => $ERROR ASSERT => $DEBUG FAULT => $ERROR INFO => $INFO ALERT => $FATAL NOTICE => $INFO FAILURE => $FATAL WARNING => $WARN PANIC => $FATAL MISTAKE => $WARN
See DESCRIPTION in Log::Report::Dispatcher
See Available back-ends in Log::Report::Dispatcher
See Addition information in Log::Report::Dispatcher
See Filters in Log::Report::Dispatcher