After further testing, I found problems with the way I was parsing the XML document,
and had to revert the changes I previously mentioned.
For now, Chainsaw V2 can only load XML files which are a collection of log4j:event
nodes - no XML declaration, doctype or eventSet root node. It should be easy to add
support for complete documents, but ran out of time for now.
Here is an example of an xml file that can be loaded by Chainsaw V2. Hope this helps.
------------------
<log4j:event logger="org.apache.struts.util.RequestUtils" timestamp="1085076287450"
sequenceNumber="0" level="DEBUG" thread="ExecuteThread: '9' for queue:
'weblogic.kernel.Default'">
<log4j:message><![CDATA[Get module name for path /AdhocEnquiry.do]]></log4j:message>
<log4j:properties>
<log4j:data name="log4j.remoteSourceInfo" value="longmdappd17.uk.db.com:4500"/>
<log4j:data name="log4jid" value="1"/>
</log4j:properties>
</log4j:event>
<log4j:event logger="org.apache.struts.util.RequestUtils" timestamp="1085076287450"
sequenceNumber="0" level="DEBUG" thread="ExecuteThread: '9' for queue:
'weblogic.kernel.Default'">
<log4j:message><![CDATA[Get module name for path /AdhocEnquiry.do]]></log4j:message>
<log4j:properties>
<log4j:data name="log4j.remoteSourceInfo" value="longmdappd17.uk.db.com:4500"/>
<log4j:data name="log4jid" value="2"/>
</log4j:properties>
</log4j:event>
<log4j:event logger="org.apache.struts.util.RequestUtils" timestamp="1085076287450"
sequenceNumber="0" level="DEBUG" thread="ExecuteThread: '9' for queue:
'weblogic.kernel.Default'">
<log4j:message><![CDATA[Get module name for path /AdhocEnquiry.do]]></log4j:message>
<log4j:properties>
<log4j:data name="log4j.remoteSourceInfo" value="longmdappd17.uk.db.com:4500"/>
<log4j:data name="log4jid" value="3"/>
</log4j:properties>
</log4j:event>
-------------------
-----Original Message-----
From: Stephen Pain [mailto:[EMAIL PROTECTED]
Sent: Thu 5/20/2004 4:51 PM
To: [EMAIL PROTECTED]
Cc:
Subject: problem loading xml events to chainsaw
Hi,
Been using chainsaw v2 for a couple of days - can't get enough of it, I've introduced
the rest of the team to it and we're tidying up the logging in our application to get
the most benefit possible, but I'm having a problem loading xml events from a file
into chainsaw...
When I try this file, for example (CTRL-O, find file in browse dialog, click OK):
<?xml version="1.0" ?>
<!DOCTYPE log4j:eventSet SYSTEM "log4j.dtd">
<log4j:eventSet xmlns:log4j="http://jakarta.apache.org/log4j/" debug="true">
<log4j:event logger="org.apache.struts.util.RequestUtils" timestamp="1085076287450"
sequenceNumber="0" level="DEBUG" thread="ExecuteThread: '9' for queue:
'weblogic.kernel.Default'">
<log4j:message><![CDATA[Get module name for path /AdhocEnquiry.do]]></log4j:message>
<log4j:properties>
<log4j:data name="log4j.remoteSourceInfo" value="longmdappd17.uk.db.com:4500"/>
<log4j:data name="log4jid" value="1"/>
</log4j:properties>
</log4j:event>
</log4j:eventSet>
I get the following in the webstart console:
piblicID: [null]
systemId: [dummy://log4j.dtd]
log4j:ERROR Parsing error on line 1 and column -1
log4j:ERROR XML declaration may only begin entities.
org.xml.sax.SAXParseException: XML declaration may only begin entities.
at org.apache.crimson.parser.Parser2.fatal(Unknown Source)
at org.apache.crimson.parser.Parser2.fatal(Unknown Source)
at org.apache.crimson.parser.Parser2.maybePI(Unknown Source)
at org.apache.crimson.parser.Parser2.content(Unknown Source)
at org.apache.crimson.parser.Parser2.maybeElement(Unknown Source)
at org.apache.crimson.parser.Parser2.parseInternal(Unknown Source)
at org.apache.crimson.parser.Parser2.parse(Unknown Source)
at org.apache.crimson.parser.XMLReaderImpl.parse(Unknown Source)
at org.apache.crimson.jaxp.DocumentBuilderImpl.parse(Unknown Source)
at org.apache.log4j.xml.XMLDecoder.parse(Unknown Source)
at org.apache.log4j.xml.XMLDecoder.decode(Unknown Source)
at org.apache.log4j.chainsaw.FileLoadAction$2.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
java.lang.NullPointerException
at org.apache.log4j.chainsaw.ChainsawAppenderHandler.appendBatch(Unknown Source)
at org.apache.log4j.chainsaw.FileLoadAction$2.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
There are *definitely not* any blank lines/spaces/etc before the <?xml...
Can anyone help? Although the SocketHubAppender is working really well for live
monitoring, we need to be able to load an existing XMLLayout log file into chainsaw
too.
Thanks in advance,
Stephen.
--
This e-mail may contain confidential and/or privileged information. If you are not the
intended recipient (or have received this e-mail in error) please notify the sender
immediately and destroy this e-mail. Any unauthorized copying, disclosure or
distribution of the material in this e-mail is strictly forbidden.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]