logging-log4j-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Nicko Cadell <ni...@Neoworks.com>
Subject RE: Small patch to display nested exceptions
Date Sat, 03 Aug 2002 19:26:39 GMT
An alternative would be to use the ObjectRenderer to render exceptions. I
have made this change in log4net and it seems to work very well. The
greatest benefit comes from allowing renderers to be specified for exception
subtypes because some exceptions don't put all the relevant info into the
message property, therefore you might need some extra code to get the
details out and you can do that by adding a renderer for that exception.

As for serialisation if you use the renderer method you have to render to
text before you serialise. You may not have the renderers defined when you
deserialise so just do it before and send the text.

Another point I would like to raise is the ObjectRenderer interface does not
support rendering of compound objects. The if the doRender(Object) method
also took a RendererMap as an argument you could write a renderer that
rendered compound objects, like for example exceptions with nested

Just some thoughts,

> -----Original Message-----
> From: Ceki Gülcü [mailto:ceki@qos.ch] 
> Sent: 02 August 2002 09:59
> To: costinm@covalent.net
> Cc: log4j-dev@jakarta.apache.org
> Subject: Re: Small patch to display nested exceptions
> Costin,
> I really appreciate your patch. However, as I explained in my 
> previous mail it only solves the problem locally and only for 
> those appenders that derive from WriterAppender. Don't you 
> think it would be better if commons-logging added this 
> feature as a Decoration to log4j? Do you see any 
> inconveniences with the Decoration approach?
> At 20:53 01.08.2002 -0700, costinm@covalent.net wrote:
> >Hi Ceki,
> >
> >Tomcat3.3 logger has the nice feature of displaying 'nested 
> >exceptions', which is extremely valuable in debugging. So 
> does jdk1.4 
> >logger.
> >
> >I couldn't find such thing in log4j - so I wrote a small patch ( 
> >cut&paste from 33 logger ).
> >
> >Costin
> --
> Ceki

To unsubscribe, e-mail:   <mailto:log4j-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:log4j-dev-help@jakarta.apache.org>

View raw message