[slf4j-dev] Re: TRACE level

Greg Wilkins gregw at mortbay.com
Wed Jul 6 16:34:34 CEST 2005


Endre Stølsvik wrote:
> (PS: You all probably know this "trick", but anyway, I find it such a good 
> practice, and apparently some developers still don't use it: if you have a 
> checked Exception that "will never occur", then still don't let the catch 
> block be empty. At some point this thing WILL happen, and there is no way 
> you'll catch it, or you'll catch something totally weird way down in the 
> code.

Endre,

the main use-case for ignore is not for exception that you don't think will
happen.

It is for exceptions that you know will happen as part of normal operation.

They are not warnings and they are not errors.  They are also too verbose for debug.

The example I use is that the Jetty server has to deal with lots of IOExceptions
when IE closes the connection halfway through a response (because they are too lazy
to implement if-modified-since usage).

If Jetty logs these exceptions in debug - the debug becomes very verbose and many
developers get confused by the stack traces scrolling by (even when labelled with IGNORE message).

If Jetty does not log them, then there is always that case when you really really really
need to know what is happening and need to see at least that the exception occured and
sometimes you also need the stack trace.

cheers




More information about the slf4j-dev mailing list