You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4j-user@logging.apache.org by Siros Supavita <si...@pathway-systems.com> on 2001/12/17 05:04:55 UTC

When application code needs to be aware of loggig operation.

Hello.

I'm relatively new to log4. I found from FAQ that log4j is fail-stop and it
is supposed to never throw any exception. I think that is the way it should
be. But when "some" logging operations become essential for our application,
says, the application needs to be aware of the completeness of logging
process. Application code may alter or discontinue operation upon some
logging failure.

I think I still needs log4j for logging operations which would not affect
application logic (and I also enjoy what log4j provides, Appender, Layout,
hierachy model, and also the way to customize). What I am curious is what
can I do to have my application code get notified by the logger when
something fail. I take a look at ErrorHandler interface and thinking about
writing my custom ErrorHandler class implementing this interface to throw
RuntimeException upon failure. Then the code which logs to the appender
which has my custom ErrorHandler class attached to, will get exception when
there is an error in that appender. Am I right ? Is it Ok to do that ? Are
there any smarter ways ?

Thank you in advance.
Siros S.



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>