Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Log4perl question: using different log levels for different appenders

by rrwo (Friar)
on Jul 20, 2004 at 01:27 UTC ( [id://375754]=perlquestion: print w/replies, xml ) Need Help??

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.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://375754]
Approved by kvale
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (3)
As of 2024-04-26 00:33 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found