From: Brian Candler Date: 2008-08-31T04:27:07+09:00 Subject: Re: How to use log4r to generate xml format log file? > That's a good point. Nevertheless log4j does offer an XMLAppender. > > It logs in 'XMLfragments' though - its up to you to complete the XML doc > when you come to parse the log though. Does that mean it just appends fragments without a root element? So to parse it, you have to prepend a and append a first? > The Jabber chat/messaging (xml-router in fact) has the same issue Not exactly: it sends a root element, and because it's a stream, the receiver blocks waiting for more data. ... ... <---- at this point a stream parser waits for either the closing or another When the other side wants to close the connection it sends then disconnects. So taking the entirety of the stream, from when it starts to when it is finished, it is valid XML and it can be parsed using a normal parser. Regards, Brian.