logging-log4j-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Oliver Burn <oli...@puppycrawl.com>
Subject RE: XMLLayout and throwable element
Date Sat, 27 Apr 2002 08:16:45 GMT
Ceki Gülcü writes:
 > 
 > How about, if each <log4j:event> record comes with a version attribute?
 > The inconvenience with this is that the version information is usually
 > required just once and having the version attribute in each record is
 > highly redundant.
 > 
 > An alternative solution is to add a version attribute in the <log4j:eventSet>
 > element in *log4j.dtd*, document this attribute in XMLLayout javadoc and let
 > the user fill it out for her data.
 > 
 > <?xml version="1.0" ?>
 > 
 > <!DOCTYPE log4j:eventSet SYSTEM "log4j.dtd" [<!ENTITY data SYSTEM "abc">]>
 > 
 > <log4j:eventSet version="1.2" xmlns:log4j="http://jakarta.apache.org/log4j/">
 >    &data;
 > </log4j:eventSet>
 > 
 > This requires a little work by the user. Moreover, the approach can be applied
 > to earlier data generated by log4j 1.2c1 and earlier. The user would then 
 > write:
 > 
 > <log4j:eventSet version="1.1" xmlns:log4j="http://jakarta.apache.org/log4j/">
 >    &data;
 > </log4j:eventSet>
 > 
 > I suggest we go for the latter solution(version attrib in log4j:eventSet).
 > Any comments?

The suggested approach does not solve the problem from programs like
Checkstyle that load the XML file. This is because the generated file does not
contain a <log4j:eventSet> tag.

In fact, to parse the XMLLayout file, Chainsaw has to construct an XML
document with the <log4j:eventSet> tag. So when Chainsaw constructs this tag,
is will not know what version number to use without first scanning the file
and looking at the format.

I think it is a good idea to include the version attribute, it just does not
solve the problem I first raised.

Regards,
Oliver

 > 
 > At 07:39 26.04.2002 +1000, Oliver wrote:
 > >It is a good idea. Just be aware that it may break Chainsaw being able
 > >to load the throwable information. This will most likely be the case
 > >for other people who have written tools to load it.
 > >
 > >I will fix Chainsaw to work, I would like to be backwards compatible
 > >so people can load both the old format, and the new one. Pity there
 > >is not version information in the XML file so Chainsaw would know
 > >how to handle the throwable information.
 > >
 > >Oliver
 > 
 > --
 > Ceki
 > 
 > 
 > --
 > To unsubscribe, e-mail:   <mailto:log4j-dev-unsubscribe@jakarta.apache.org>
 > For additional commands, e-mail: <mailto:log4j-dev-help@jakarta.apache.org>
 > 


--
To unsubscribe, e-mail:   <mailto:log4j-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:log4j-dev-help@jakarta.apache.org>


Mime
View raw message