From: Mike S. <msc...@ao...> - 2004-01-13 08:42:08
|
Stathy G Touloumis wrote on 1/12/2004, 12:59 PM: > I can't seem to get Log::Log4perl to work with > Log::Dispatch::Email::MailSendmail even though using > Log::Dispatch::Email::MailSendmail on the command line works fine. Just tried it -- works for me. The only thing I changed was that I set "buffered" to 0, since the default mode of Email::MailSendmail seems to be 1, which causes messages to be buffered and not to be sent out. Here's the code: use Log::Log4perl; Log::Log4perl::init(\q{ log4perl.logger.mapping = ERROR, Errormapping, Tnotify log4perl.additivity.mapping = 0 log4perl.appender.Tnotify = Log::Dispatch::Email::MailSendmail log4perl.appender.Tnotify.name = tnotify log4perl.appender.Tnotify.min_level = debug log4perl.appender.Tnotify.from = fo...@ba... log4perl.appender.Tnotify.to = m...@pe... log4perl.appender.Tnotify.layout = Log::Log4perl::Layout::SimpleLayout log4perl.appender.Tnotify.buffered = 0 log4perl.appender.Errormapping = Log::Log4perl::Appender::Screen log4perl.appender.Errormapping.mode = clobber log4perl.appender.Errormapping.autoflush = 1 log4perl.appender.Errormapping.filename = ./error_mapping.txt log4perl.appender.Errormapping.layout = Log::Log4perl::Layout::PatternLayout log4perl.appender.Errormapping.layout.ConversionPattern = %m%n%n }); my $logger = Log::Log4perl::get_logger("mapping"); $logger->error("blah"); __END__ -- -- Mike Mike Schilli m...@pe... |