You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4j-user@logging.apache.org by Mike Blake-Knox <mi...@gmail.com> on 2005/03/18 14:54:38 UTC

chainsaw and "escaping" XML entities

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

---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-user-help@logging.apache.org


Re: chainsaw and "escaping" XML entities

Posted by Curt Arnold <ca...@apache.org>.
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.



On Mar 18, 2005, at 7:54 AM, Mike Blake-Knox wrote:

> 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.Messages.Me 
> ssageSent"
> />
>         <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
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
> For additional commands, e-mail: log4j-user-help@logging.apache.org
>


---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-user-help@logging.apache.org


Fwd: chainsaw and "escaping" XML entities

Posted by Mike Blake-Knox <mi...@gmail.com>.
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 <mi...@gmail.com>
Date: Fri, 18 Mar 2005 08:54:38 -0500
Subject: chainsaw and "escaping" XML entities
To: Log4J Users List <lo...@logging.apache.org>

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.Messages.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 <ca...@apache.org>
Date: Fri, 18 Mar 2005 13:30:55 -0600
Subject: Re: chainsaw and "escaping" XML entities
To: Log4J Users List <lo...@logging.apache.org>


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