manoharp has asked for the wisdom of the Perl Monks concerning the following question:

How to make one appender in Log4perl to always have INFO message and other appenders have log messages based on the rootlogger level. For Instance: I need a File Appender, which should have all the INFO messages, but on the other hand the STDERR or Screen Appender should have the log messages based on the log level I set. I generally set the log level for Screen in the config itself, and I need to have option to override the stuffs at the script level. Would greatly appreciate your help in this regard! Thanks, -Pravin
  • Comment on Log4perl: Appender to act independent of the Root Logger Level..

Replies are listed 'Best First'.
Re: Log4perl: Appender to act independent of the Root Logger Level..
by andreas1234567 (Vicar) on Oct 15, 2007 at 11:56 UTC
Re: Log4perl: Appender to act independent of the Root Logger Level..
by saintmike (Vicar) on Oct 26, 2007 at 18:07 UTC
    Your levels are defined with your loggers, not with your appenders, so simply put them in the same logger line:
    log4perl.category.Bar.Twix = WARN, Logfile, Screen, Whatever
    and they will be used with the same level.