Re: Using XML for audit trail
John Brett <[email protected]> Fri, 27 Feb 2009 07:41:07 +0000
| Newsgroups | gmane.comp.windows.devel.dotnet.advanced |
|---|---|
| Message-ID | <[email protected]> |
Hi Mont, I've just been through the same thought exercise. I concluded that xml simply isn't a good format to use for a continual logging system. My conclusions were, in part, based upon seeing an internal system that did pretty much what you're describing fail periodically, leaving behind a log file that was no longer valid xml (and therefore couldn't be parsed by all the standard tools we had in place). Trying to read a 10Mb sort-of xml document in a text editor to diagnose faults is pretty tedious. My solution was to use a different serialisation format (structured text) that was record-oriented, and then to have a separate phase which could convert a given snapshot of the log into xml. HTH, John 2009/2/27 Mont Rothstein <[email protected]>: > I want to use XML for an audit trail. The problem I am having is that I > would like to only use append operations to write to the file. > > My thought had been to write an element to each line, with sub-elements and > the end on the same line. I could then parse each line when reading the > file. The problem is I can't figure out how to get the XML for a > node/element/document, and all of the sub-elements, to write out as a single > line. > > Alternatively I could use some other mechanism to parse the file and read > each audit entry (xml element with sub-elements) in sequence. > > Any suggestions on how to either write the XML as a single line or a > preferred method for parsing elements in a file one at a time? > > Thanks, > -Mont > > =================================== > View archives and manage your subscription(s) at http://peach.ease.lsoft.com/archives > =================================== View archives and manage your subscription(s) at http://peach.ease.lsoft.com/archives