[prev in list] [next in list] [prev in thread] [next in thread] 

List:       log4net-user
Subject:    RE: Oh where, oh where has my little RenderException() gone?
From:       "Nicko Cadell" <nicko () neoworks ! com>
Date:       2006-04-23 21:51:00
Message-ID: DDEB64C8619AC64DBC074208B046611C7698B9 () kronos ! neoworks ! co ! uk
[Download RAW message or body]

The RenderException functionality was removed because most exceptions
provide an overridden ToString method which includes the required
details. The implementation of RenderException only included the
exception Type, Message, Source, Stack Trace and nested exception. If a
specific exception has more information then it is reasonable to expect
that it will be included as part of the exception's ToString().

> I use the old RenderException method in a class that derives 
> from DefaultRenderer to get Exceptions to into a workable XML format.

Note that the RenderException method did not produce valid XML, nor was
it designed to.

If you need to implement a custom rendering for your own exception types
(or any other types) then write an object that implements the
IObjectRenderer interface supports the rendering of your type. You can
implement a separate object for each type or a single type that handles
all your custom types. Then register your object renderer for your
custom types by specifying the <renderer> tag in the config file:

<renderer renderingClass="MyExceptionRenderer"
renderedClass="MyClass.MyFunkyException" />

Cheers,
Nicko

> -----Original Message-----
> From: Zimney, Christopher M. [mailto:christopher.zimney@wamu.net] 
> Sent: 18 April 2006 22:55
> To: log4net-user@logging.apache.org
> Subject: Oh where, oh where has my little RenderException() gone?
> 
> I use the old RenderException method in a class that derives 
> from DefaultRenderer to get Exceptions to into a workable XML format.
> 
> Looking through 1.2.9 stuff, I see that this has gone far, 
> far away and isn't listed in the breaking changes section of 
> the docs.  Was anyone else using this method and found a work 
> around without having to customize log4net source?
> 
> override protected string RenderException (RendererMap 
> rendererMap, Exception e) 
> 
> Sadly,
> 
> chris
> 
> 

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic