[slf4j-dev] Ignore method.
Curt Arnold
carnold at houston.rr.com
Wed Jun 29 17:12:23 CEST 2005
On Jun 29, 2005, at 9:25 AM, Ceki Gülcü wrote:
>
> Greg,
>
> For the moment, I'd like to pursue the discussion regarding ignore()
> and ignore (pun intended) the trace debate.
>
> After carefully reading your commments, I was able to get a clearer
> picture of the use case. Here is a reformulation of your comments as
> requriements for a special use case.
> Requirements
> ============
>
...
My initial thoughts (from a log4j perspective) is that being able to
configure a threshold level at which exceptions are rendered by the
layout possibly might be sufficient. So for example, you could still
use:
try {
// invoke somebody elses code or do some protocol stuff
...
} catch(IOException e)
loggger.debug("Expected exception when socket closed", e);
}
but you could configure that stack traces for debug level exceptions
are not displayed while stack traces in exceptions in info and higher
level logging requests are displayed.
However this would only work with logging frameworks (don't know of
any, but maybe log4j 1.3 could) that provide a mechanism to
selectively render stack traces based on level. For this to work in
slf4j with existing frameworks, maybe you could tweak the semantics
of trace(String, Exception) so that an slf4j bridge implementation
will drop the exception when dispatching to logging frameworks that
don't support configure of exception rendering. Or provide a means
to set the threshold level at which exceptions are passed to the
logging framework.
More information about the slf4j-dev
mailing list