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

I'm just learning how to use Log4perl, and would like to figure out how (if it's possible) to log at different levels for different appenders.

In other words, I'd like to limit messages sent to the Screen to warnings or stronger, but have information messages (or stronger) sent to a log file.

  • Comment on Log4perl question: using different log levels for different appenders

Replies are listed 'Best First'.
Re: Log4perl question: using different log levels for different appenders
by Anonymous Monk on Jul 20, 2004 at 13:01 UTC

    Yes, it can be done using filters, rather easily. I suggest you read the Log4Perl FAQ on CPAN, specifically have a look at this entry. You will need to tweak the example to get what you want, but it should put you on the right course.

    Ted

Re: Log4perl question: using different log levels for different appenders
by Jaap (Curate) on Jul 20, 2004 at 09:48 UTC
    I don't know if that's possible with the standard module but it would be a nice feature so if it isn't already there, you might like to implement it and send it to the author.