Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
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
Replies are listed 'Best First'.
Re: [Log4perl] adding actions to messages
by Perlbotics (Canon) on Aug 19, 2011 at 10:10 UTC
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 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

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 examining the Monastery: (10)
As of 2015-07-08 05:39 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (94 votes), past polls