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 "José (bluemail)" <jo...@bluewin.ch> on 2008/06/28 00:03:10 UTC

Parsing a log generated by a RollingFileAppender with LINQ to XML

Hello, 

This post is not directly related to log4net. However, I have a parsing
issue with one of the generated log file.

I'm currently trying to parse (with LINQ to XML) a log file generated by a
RollingFileAppender.
It has the format as shown at the end of this post (XML fragment, undeclared
namespace).

I tried to load it using the XElement.Load() method. However, it throws an
exception telling me that the "log4j" namespace is undeclared.

Has anyone already tried to load such a file using linq?

Thanks for any feedback!
José

 

<log4j:event logger="InternalLog" timestamp="1214275497000" level="DEBUG"
thread="943180"><log4j:message>completed registering new logger for category
AFCLOGGING</log4j:message><log4j:properties><log4j:data name="application"
value="WindowsCE" /><log4j:data name="log4net:UserName" value="NOT
AVAILABLE" /><log4j:data name="log4jmachinename" value="WindowsCE"
/><log4j:data name="log4net:Identity" value="NOT AVAILABLE" /><log4j:data
name="log4net:HostName" value="WindowsCE" /><log4j:data name="log4japp"
value="DBUtilities.SQL.UnitTestsCE.exe"
/></log4j:properties><log4j:locationInfo class="AFCLogging.Logging"
method="Logging" file="Logging.cs" line="82" /></log4j:event>

<log4j:event logger="InternalLog" timestamp="1214275498000" level="DEBUG"
thread="943180"><log4j:message>completed registering new logger for category
InternalLog</log4j:message><log4j:properties><log4j:data name="application"
value="WindowsCE" /><log4j:data name="log4net:UserName" value="NOT
AVAILABLE" /><log4j:data name="log4jmachinename" value="WindowsCE"
/><log4j:data name="log4net:Identity" value="NOT AVAILABLE" /><log4j:data
name="log4net:HostName" value="WindowsCE" /><log4j:data name="log4japp"
value="DBUtilities.SQL.UnitTestsCE.exe"
/></log4j:properties><log4j:locationInfo class="AFCLogging.Logging"
method="Logging" file="Logging.cs" line="82" /></log4j:event>
.....