The XMLLayout is designed to emit a fixed XML schema. It does not
support extending the schema through message data. Therefore it will
escape any characters in the message (or other logged data) to make a
valid XML Text element.

If you want to extend the schema written by the appender you will need
to write your own Layout. You should be able to start with the XMLLayout
and modify it to embed XML rather than Text for the message.

Nicko 

> -----Original Message-----
> From: Senthil Sivasubramanian S [mailto:[EMAIL PROTECTED] 
> Sent: 23 September 2004 08:09
> To: [email protected]
> Subject: Query on XMLLayout
> 
> When I try to log 
>  
> "<Node Name="Object"><Field Name="Instrument" Value="Xyz"/></Node>"
>  
> through the XMLLayout for the FileAppender, the log4net 
> library logs this message within a <![CDATA[...]]> section. I 
> believe the log4net library is doing this because of the 
> presence of all those unknown XML tags.
>  
> How can I avoid log4net from placing the message within the 
> CDATA section, since I am sure of the validity of those 
> <Node> and <Field> XML tags being properly placed. My intent 
> is to use an XML viewer to open the XML log output and be 
> able to study the logs after a sort based on these <Node> and 
> <Field> XML tags.
>  
> Thanks.
> 
> --
> Senthil SS. 
> Extn: 371 
> 
>  
> 

Reply via email to