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?

Replies are listed 'Best First'.
Re: [Log4perl] adding actions to messages
by Perlbotics (Archbishop) 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