This is what the javadoc says:

The output of the XMLLayout consists of a series of log4j:event
elements as defined in the log4j.dtd. It does not output a complete
well-formed XML file. The output is designed to be included as an
external entity in a separate file to form a correct XML file.

For example, if abc is the name of the file where the XMLLayout ouput
goes, then a well-formed XML file would be:

<?xml version="1.0" ?>

<!DOCTYPE log4j:eventSet SYSTEM "log4j.dtd" [<!ENTITY data SYSTEM "abc">]>

<log4j:eventSet xmlns:log4j="http://jakarta.apache.org/log4j/";>
  &data;
</log4j:eventSet>

This approach enforces the independence of the XMLLayout and the
appender where it is embedded.



At 05:08 25.07.2001 +0530, you wrote:

>Hi folks,
>
>  I started using log4j recently and have started liking it. I needed a xml
>based log output format.
>So I used org.apache.log4j.xml.XMLLayout & RollingFileAppender and found
>that it is quite good.
>However it does not generate well formed xml documents. There is no root tag
>and hence the parsers
>throw error while parsing.
>Can somebody point me to an XMLFileAppender if it exists or any better
>solution to get a well fomed xml document ?
>
>Thanks
>Balaji
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]

--
Ceki Gülcü - http://qos.ch


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to