You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4net-user@logging.apache.org by Thibaut Barrère <th...@gmail.com> on 2004/10/27 10:18:30 UTC
Re: Please Can u bail me out!!!
Hi Amit
> 1)As specified I added DictinoryRenderer.cs class in log4net src
actually it's not necessary to do this; your DictionaryRenderer can be
just part of your own application assemblies. This avoid to recompile
log4net.
> 2)config settings :<renderer renderingClass="log4net.ObjectRenderer.DictionaryRenderer"></renderer>
see here : http://logging.apache.org/log4net/release/manual/configuration.html#HC-13011608
you didn't specify the renderedClass attribute, which is required. The
doc states that it "must be the type name for the target type for this
renderer. If the type is not defined in the log4net assembly this type
name must be fully assembly qualified. This is the name of the type
that this renderer will render."
which means : the type of object you want to render. In our case, the
fully qualified name of the rendered class is
"System.Collection,IDictionary,mscorlib"
a valid config could be :
<renderer
renderingClass="MyNameSpace.Logging.DictionaryRenderer, MyAssemblyName"
renderedClass="System.Collections.IDictionary,mscorlib" />
where you should replace renderingClass to match your renderer fully
qualified name.
> 4)The output I am getting is
> ::[0 ] [2004-10-27 12:05:54,677] [2764] [FATAL] d:[Path] 328 btnRender_Click - System.Collections.Hashtable
This shows that your dictionary renderer has not been properly
registered (for the reasons explained earlier). By default the
rendering system will fallback to a ToString() call on the object you
passed, hence you get "System.Collections.Hashtable".
Thibaut