From: John Pritchard-williams Date: 2008-08-30T07:44:24+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. The Jabber chat/messaging (xml-router in fact) has the same issue: it also sends information back and forth as XML-frags - you have to put them back together at some point to make valid XML. Brian Candler wrote: >> I want to use log4r to generate xml formatted log file > > Aside: is there a standard way of using XML for log files? I had a need > for > writing structured data to a log a while ago, and considered XML, but > rejected it on the grounds that anything which appends is always going > to > generate invalid (i.e. not-well-formed) XML. For example: > > > foo > > > bar > > > This is malformed because it has more than one root node, and therefore > will > be rejected by just about any XML parser. Similarly, > > > > foo > > > bar > > > is also malformed, until such time that you append the closing > > tag (but at that point you can no longer append any more logs to that > file). > > Regards, > > Brian. -- Posted via http://www.ruby-forum.com/.