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
exceptions.

Just some thoughts,
Nicko

> -----Original Message-----
> From: Ceki G�lc� [mailto:[EMAIL PROTECTED]] 
> Sent: 02 August 2002 09:59
> To: [EMAIL PROTECTED]
> Cc: [EMAIL PROTECTED]
> 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, [EMAIL PROTECTED] 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:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to