In XML 1.1 so called restricted chars are allowed to be included as
numeric character references (i.e. ).

For details see 
http://www.w3.org/TR/2004/REC-xml11-20040204/#charsets
and also 
http://www.w3.org/International/questions/qa-controls#answer

If you change the version header at the top of the XML file to 1.1 can
chainsaw parse the event?

I will have a look and see if it is possible to control the behaviour of
the XmlTextWriter with respect to the target XML version.

Nicko

> -----Original Message-----
> From: Mike Blake-Knox [mailto:[EMAIL PROTECTED] 
> Sent: 21 March 2005 14:36
> To: Log4NET User
> Subject: Fwd: chainsaw and "escaping" XML entities
> 
> I found a situation where Chainsaw didn't display logs as 
> Chainsaw took an exception when it tried to handle some x01e 
> characters in the log text.
> 
> It appears that log4net is generating malformed XML.
> 
> Here's my posting in log4j Users and the reply to it:
> 
> 
> ---------- Forwarded message ----------
> From: Mike Blake-Knox <[EMAIL PROTECTED]>
> Date: Fri, 18 Mar 2005 08:54:38 -0500
> Subject: chainsaw and "escaping" XML entities
> To: Log4J Users List <[email protected]>
> 
> I'm using log4net to generate log files that I'm reading with 
> chainsaw. Some of the "text" of a log message may contain 
> control characters (e.g., with a value of 0x1e"). Log4net 
> escapes them as XML entinties (e.g., &#x1E;).
> 
> When chainsaw using the UdpReceiver tries to parse the log, it fails.
> 
> Here's an example of a complete failing log:
> 
> <log4j:event 
> logger="TSYS.BPM.CTI.Server.LoggingServices.Appenders.log4netAppender"
> timestamp="1111077123337" level="DEBUG"thread="2424">
>   <log4j:message>[11:22:18]: Sending [AGTLogon C403611980 1 1 
> 2&#x1E;xxxx&#x1E;yyyy].</log4j:message>
>   <log4j:properties>
>       <log4j:data
> name="MessageID"value="TSYS.BPM.CTI.Switch.Mosaix.MosaixIS.Mes
> sages.MessageSent"
> />
>       <log4j:data name="LevelDetail" value="Medium" />
>       <log4j:dataname="log4japp" value="zzzCTIServer.exe" />
>       <log4j:data name="log4net:UserName" value="PCS\mblakeknox" />
>       <log4j:dataname="log4jmachinename" value="bpmncprdev4" />
>       <log4j:data name="log4net:HostName" value="bpmncprdev4"/>
>   </log4j:properties>
> </log4j:event>
> 
> --
> Mike Blake-Knox
> 
> ---------- Forwarded message ----------
> From: Curt Arnold <[EMAIL PROTECTED]>
> Date: Fri, 18 Mar 2005 13:30:55 -0600
> Subject: Re: chainsaw and "escaping" XML entities
> To: Log4J Users List <[email protected]>
> 
> 
> Per the XML 1.0 recommendation, http://www.w3.org/TR/REC-xml/ 
> #charsets,  #x1E is not a valid character and should not 
> occur in an XML document even if escaped as a character 
> entity.  Any XML parser may (might be should or must, but I'd 
> need to check) reject such a document as not being valid XML. 
>  This particular problem is then a bug in log4net, though I 
> suspect that there are similar problems with log4j and 
> log4cxx generation of XML logs.
> 
> 
> --
> Mike Blake-Knox
> 

Reply via email to