logging-log4j-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ceki Gülcü <c...@qos.ch>
Subject Re: ObjectRenderers
Date Fri, 10 Dec 2004 15:05:57 GMT

Mike,

ObjectRendering is not automatically applied to the second argument of
printing methods but only to the first one (the message). Would you
care to explain how you'd like exceptions to be displayed?

BTW, if you are using log4j 1.3 and PatternLayout, you can register a
pattern converter for exceptions. PatternLayout will delegate
displaying the exception to your converter and the containing appender
will honor your custom treatment of the exception.

At 03:56 PM 12/10/2004, Rieser, Michael (SCI TW) wrote:
>Is it possible to override the default logging behavior of 
>Exceptions/Throwables?
>
>I've been able to get ObjectRenderers to work for the logging signatures 
>like the following:
>         logger.debug(new Exception("error message");
>
>but those which take the throwable as an additional argument don't seem to 
>obey the Renderer
>         logger.debug("error message", new Exception("won't be rendered 
> the way I want");
>
>Any help would be appreciated.
>
>Thanks,
>Mike

-- 
Ceki Gülcü

  The complete log4j manual:  http://qos.ch/log4j/  



---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-user-help@logging.apache.org


Mime
View raw message