Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

[Log4perl] adding actions to messages

by menth0l (Monk)
on Aug 19, 2011 at 09:38 UTC ( #921199=perlquestion: print w/ replies, xml ) Need Help??
menth0l has asked for the wisdom of the Perl Monks concerning the following question:

Is there an option in Log4perl to add action(s) to messages at certain level? For example i I'd like to shutdown whole application (I mean clean shutdown: stopping all threads, closing handles etc.) when error of type FATAL occurs. Does L4p exposes an interface of that kind or do I have to do some hacking?

Comment on [Log4perl] adding actions to messages
Re: [Log4perl] adding actions to messages
by Anonymous Monk on Aug 19, 2011 at 09:42 UTC

    Does L4p exposes an interface of that kind or do I have to do some hacking?

    Seeing how you can write your own buffers, formatters, filters .... yes, l4p does expose an interface

Re: [Log4perl] adding actions to messages
by moritz (Cardinal) on Aug 19, 2011 at 09:58 UTC
    In my humble opinion, it's not the task of the logging framework to do a shutdown. You should rather have an error handler inside your application which does that, and the error handler can in turn call some logging routines.
Re: [Log4perl] adding actions to messages
by Perlbotics (Abbot) on Aug 19, 2011 at 10:10 UTC

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (10)
As of 2014-11-27 10:53 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My preferred Perl binaries come from:














    Results (183 votes), past polls