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 Chris Hane <ch...@hane.com> on 2002/08/12 09:55:47 UTC
XMLLayout & Chainsaw
Hopefully this is a quick question. I'm trying to get Chainsaw to read a
file created with XMLLayout. I've read the XMLLayout javadoc and have not
been able to figure out exactly what I need to do to modify the output so
that chainsaw will read the file in. I will admit that I am not an XML expert.
If I have the following in a file called log.xml what do I need to add
around it in order that I can open the file in chainsaw. Also, I'm using
the latest version of log4j 1.2.6.
<log4j:event logger="com.test" timestamp="1029135031807" level="DEBUG"
thread="main">
<log4j:message><![CDATA[Create new test]]></log4j:message>
<log4j:NDC><![CDATA[I am test 1]]></log4j:NDC>
</log4j:event>
I've tried different variations of the <!DOCTYPE> syntax in the XMLLayout
javadoc but seem to be missing something. For all of the files I try to
read I get a dialog box poping up in chainsaw saying "error parsing file -
null". The expection message thrown is:
[AWT-EventQueue-0] INFO org.apache.log4j.chainsaw.LoadXMLAction - load file
called
[AWT-EventQueue-0] INFO org.apache.log4j.chainsaw.LoadXMLAction - Need to
load a file
[AWT-EventQueue-0] INFO org.apache.log4j.chainsaw.LoadXMLAction - loading
the contents of C:\Data\CVSHOME\itsolut\dist\log.xml
[AWT-EventQueue-0] WARN org.apache.log4j.chainsaw.LoadXMLAction - caught an
exception loading the file
java.lang.NullPointerException
at org.apache.xerces.framework.XMLParser.parse(XMLParser.java:925)
at
org.apache.log4j.chainsaw.LoadXMLAction.loadFile(LoadXMLAction.java:126)
at
org.apache.log4j.chainsaw.LoadXMLAction.actionPerformed(LoadXMLAction.java:84)
at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
at
javax.swing.AbstractButton$ForwardActionEvents.actionPerformed(Unknow
<snip/>
Thanks in advance,
Chris....
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>
Re: XMLLayout & Chainsaw
Posted by Chris Hane <ch...@hane.com>.
Figures that I would get it working after asking for help. Turns out it
was the version of the xml parser. While chainsaw will startup with
xerces-1.x it will not parse the file. I tried the XercesJ-2.x (the latest
one) and could not get it to work. I did get it to work with the crimson
parser - at least the one bundled with tomcat 4.0....
Question, should it work with Xerces 2.x?
Thanks,
Chris....
At 8/12/2002 02:55 AM, you wrote:
>Hopefully this is a quick question. I'm trying to get Chainsaw to read a
>file created with XMLLayout. I've read the XMLLayout javadoc and have not
>been able to figure out exactly what I need to do to modify the output so
>that chainsaw will read the file in. I will admit that I am not an XML expert.
>
>If I have the following in a file called log.xml what do I need to add
>around it in order that I can open the file in chainsaw. Also, I'm using
>the latest version of log4j 1.2.6.
>
><log4j:event logger="com.test" timestamp="1029135031807" level="DEBUG"
>thread="main">
><log4j:message><![CDATA[Create new test]]></log4j:message>
><log4j:NDC><![CDATA[I am test 1]]></log4j:NDC>
></log4j:event>
>
>I've tried different variations of the <!DOCTYPE> syntax in the XMLLayout
>javadoc but seem to be missing something. For all of the files I try to
>read I get a dialog box poping up in chainsaw saying "error parsing file
>- null". The expection message thrown is:
>
>[AWT-EventQueue-0] INFO org.apache.log4j.chainsaw.LoadXMLAction - load
>file called
>[AWT-EventQueue-0] INFO org.apache.log4j.chainsaw.LoadXMLAction - Need to
>load a file
>[AWT-EventQueue-0] INFO org.apache.log4j.chainsaw.LoadXMLAction - loading
>the contents of C:\Data\CVSHOME\itsolut\dist\log.xml
>[AWT-EventQueue-0] WARN org.apache.log4j.chainsaw.LoadXMLAction - caught
>an exception loading the file
>java.lang.NullPointerException
> at org.apache.xerces.framework.XMLParser.parse(XMLParser.java:925)
> at
> org.apache.log4j.chainsaw.LoadXMLAction.loadFile(LoadXMLAction.java:126)
> at
> org.apache.log4j.chainsaw.LoadXMLAction.actionPerformed(LoadXMLAction.java:84)
> at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
> at
> javax.swing.AbstractButton$ForwardActionEvents.actionPerformed(Unknow
><snip/>
>
>
>Thanks in advance,
>Chris....
>
>
>--
>To unsubscribe, e-mail: <ma...@jakarta.apache.org>
>For additional commands, e-mail: <ma...@jakarta.apache.org>
>
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>