views:

126

answers:

1

I've managed to configure Log4Net with a RollingFileAppender in order to generate Xml files.

However, the generated files are not valid XML files until a "roll" is performed - the XML doesn't have a closing XML tag.

Basically, this prevents to files from being read until that are "closed"/"rolled".

Anyone else encountered this issue?

I my previous (custom) solution I had to write the closing tag after writing each entry, and overwrite it with the next entry... :(

A: 

You could try reading the file with a SAX type parser. That way you should be able to read right up until the end of the file with it (if you use a non-validating parser or set it to not validate the document). Take a look at the XmlReader if you're using the .Net framework.

TskTsk