example log entry looks like: <log4j:event category="de.eurodata.Protokoll" timestamp="1022489698611" priority="INFO" thread="AWT-EventQueue-0"> ... </log4j:event> Chainsaw (from log4j 1.2.1) displays it as priority DEBUG. I think the error is in method XMLFileHandler.startElement(...): The line Priority = Priority.toPriority(aAtts.getValue("level")); is incorrect in my opinion, because the attribute name in the log4j.dtd is "priority". As a consequence, Chainsaw is using the default log level (DEBUG).
Note, that this error only occurs, when the XML log file was created with an "old" Log4J version 1.1.x. Log4J 1.2.x creates the event attribute "level" as expected by Chainsaw. (But the distributed log4j.dtd in src/java/org/apache/log4j/xml still lists "priority" as attribute name, so I was a little confused.)
The problem is that the XMLLayout class is generating XML that does not conform to the DTD. It uses "level" instead of "priority" as the DTD would suggest. I was faced with the problem of chosing between making Chainsaw support: - the DTD, but not work with 1.1 code - what the XMLLayout class generates, but not work with 1.2 code - some kludge that would support both. A kludge is required as there is no log4j version information in the output generated by XMLLayout Not liking kludges I went for the second option. The question is, should we: - fix XMLLayout to support the DTD; - put a kludge in Chainsaw to support "level" and "priority" - do both of the above. I will do whatever Ceki recommends.
The DTD should be updated to something like: <!-- The timestamp format is application dependent. --> <!ATTLIST log4j:event logger CDATA #REQUIRED level CDATA #REQUIRED thread CDATA #REQUIRED timestamp CDATA #REQUIRED > Notice the two changes category -> logger and priority -> level. I'll also update XMLLayout to conform to the dtd. When chainsaw follows suite, we'll release log4j 1.2.4. There is no point in mulling over this for ages. Reading XMLLayouts is relatively new feature such that the number of upset users by the backward compatibility problem is likely to be low.
put in the fix as requested by Ceki.