Thanks for all the emails... amazing response, I sent the email when I went to bed and 
when I got up there was the solution waiting for me :) I tried loading a log file 
without the declaration, doctype etc and it works! Very pleased...

There are a couple of issues that I have noticed though:

      1. If displaying of the Throwable column is enabled, I get an exception when I 
scroll the event list panel far enough to the right that the Throwable column is 
visible... but only for events loaded from a file (not if using the 
SocketHubAppender).  I can hide the column and the Throwable is displayed correctly in 
the detail below.  Stack trace (this is repeatable if you load in the example file in 
the email below & scroll right):

java.lang.ArrayIndexOutOfBoundsException: 0
      at 
org.apache.log4j.chainsaw.TableColorizingRenderer.getTableCellRendererComponent(Unknown
 Source)
      at javax.swing.JTable.prepareRenderer(Unknown Source)
      at javax.swing.plaf.basic.BasicTableUI.paintCell(Unknown Source)
      at javax.swing.plaf.basic.BasicTableUI.paintCells(Unknown Source)
      at javax.swing.plaf.basic.BasicTableUI.paint(Unknown Source)
      at javax.swing.plaf.ComponentUI.update(Unknown Source)
      at javax.swing.JComponent.paintComponent(Unknown Source)
      at javax.swing.JComponent.paint(Unknown Source)
      at javax.swing.JComponent.paintChildren(Unknown Source)
      at javax.swing.JComponent.paint(Unknown Source)
      at javax.swing.JViewport.paint(Unknown Source)
      at javax.swing.JComponent.paintChildren(Unknown Source)
      at javax.swing.JComponent.paint(Unknown Source)
      at javax.swing.JComponent._paintImmediately(Unknown Source)
      at javax.swing.JComponent.paintImmediately(Unknown Source)
      at javax.swing.RepaintManager.paintDirtyRegions(Unknown Source)
      at javax.swing.SystemEventQueueUtilities$ComponentWorkRequest.run(Unknown Source)
      at java.awt.event.InvocationEvent.dispatch(Unknown Source)
      at java.awt.EventQueue.dispatchEvent(Unknown Source)
      at java.awt.EventDispatchThread.pumpOneEventForHierarchy(Unknown Source)
      at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
      at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
      at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
      at java.awt.EventDispatchThread.run(Unknown Source)

      2. Location information isn't stored in the XML file, so when I save, quit and 
reload some events I don't get my Class, Method, Line and File fields populated. Is 
this something that's unavailable in the XMLLayout completely, or just because 
Chainsaw isn't using it (yet?!)?

Thanks again for your help so far!

Cheers,
Stephen



                                                                                       
                                          
                      "Scott Deboy"                                                    
                                          
                      <[EMAIL PROTECTED]        To:       "Log4J Users List" <[EMAIL 
PROTECTED]>                      
                      stems.com>               cc:                                     
                                          
                                               Subject:  RE: problem loading xml 
events to chainsaw                              
                      21/05/2004 07:24                                                 
                                          
                      Please respond to                                                
                                          
                      "Log4J Users                                                     
                                          
                      List"                                                            
                                          
                                                                                       
                                          
                                                                                       
                                          




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]




--

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]

Reply via email to