Andre_br has asked for the wisdom of the Perl Monks concerning the following question:
I´m trying to set up log4perl for my scripts but I seem to be forgetting something, as nothing gets written on the log file (nor emailed to me). Here´s my log4perl.conf:
And here´s the code supposed to be included at the beginning of my scripts:log4perl.logger=INFO, FatalFile, FatalMailer, InfoLog log4perl.filter.MatchFatal = Log::Log4perl::Filter::LevelMatch log4perl.filter.MatchFatal.LevelToMatch = FATAL log4perl.filter.MatchFatal.AcceptOnMatch = true log4perl.filter.MatchInfo = Log::Log4perl::Filter::LevelMatch log4perl.filter.MatchInfo.LevelToMatch = INFO log4perl.filter.MatchInfo.AcceptOnMatch = true log4perl.appender.FatalFile=Log::Dispatch::File log4perl.appender.FatalFile.filename=test.log log4perl.appender.FatalFile.mode=append log4perl.appender.FatalFile.layout=PatternLayout log4perl.appender.FatalFile.layout.ConversionPattern=%d %p> %F{1}:%L % +M - %m%n log4perl.appender.FatalFile.Filter = MatchFatal log4perl.appender.FatalMailer = Log::Dispatch::Email::MailSend +mail log4perl.appender.FatalMailer.to = webmaster@mysite.com log4perl.appender.FatalMailer.from = log4perl log4perl.appender.FatalMailer.subject = Something's broken! log4perl.appender.FatalMailer.layout = SimpleLayout log4perl.appender.FatalMailer.Filter = MatchFatal log4perl.appender.InfoLog=Log::Dispatch::File log4perl.appender.InfoLog.filename=mailer.log log4perl.appender.InfoLog.mode=append log4perl.appender.InfoLog.layout=PatternLayout log4perl.appender.InfoLog.layout.ConversionPattern=%d %p> %m%n log4perl.appender.InfoLog.Filter = MatchInfo
The test script runs ok, without any complaint after loading the log4perl config call, but, as I said, nothing makes it to the error logs or to my email.use Log::Log4perl; Log::Log4perl->init("/home/mysite/log4perl/log4perl.conf");
I need thy help
Thanks a lot!
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Help implementing log4perl
by izut (Chaplain) on Oct 01, 2005 at 19:48 UTC | |
|
Re: Help implementing log4perl
by johnnywang (Priest) on Oct 01, 2005 at 21:34 UTC | |
|
Re: Help implementing log4perl
by saintmike (Vicar) on Oct 02, 2005 at 18:26 UTC |