[logback-user] Exception and error safe logging

Adam Fitzgerald afitz at gatech.edu
Wed Aug 24 16:14:42 CEST 2011


For a project I'm working on we would like to be able to attempt
recovery after the occurrence exceptions and some errors, and are
investigating methods of integrating the use of logback into this
strategy.  In the case of exceptions, does logback make any guarantee
about what will/won't be thrown from the message logging methods?  Is
there anything like a 'safe' logging API that will not throw?

Secondly we want to catch OOM errors that may occur in a call to
logback.  The simplest (but tedious) approach would be to wrap the
calls in a try-catch block.  Alternatively we are considering proxying
the logger and wrapping the calls to the real logger in a try catch
within the proxy.  Can anyone forsee any issues with doing this?  Does
any kind of functionality like this already exist?

Thanks in advance,

More information about the Logback-user mailing list