Re: Using XML for audit trail

John Warner <[email protected]> Sat, 28 Feb 2009 13:28:58 -0500
Newsgroups gmane.comp.windows.devel.dotnet.advanced
Organization House
Message-ID <002401c999d2$6bdb5d10$43921730$@com>
Well, I imagine you are still creating your own DTD or schema so how would
that be all that different from your own file format?

John Warner

> -----Original Message-----
> From: Discussion of advanced .NET topics. [mailto:ADVANCED-
> [email protected]] On Behalf Of Mont Rothstein
> Sent: Saturday, February 28, 2009 1:13 PM
> To: [email protected]
> Subject: Re: [ADVANCED-DOTNET] Using XML for audit trail
> 
> OK, thanks for the clarification.  It sounds like by using fragments I
> should be safe and I can avoid creating my own record format (which is
why
> we have XML in the first place).
> -Mont
> 
> 
> On Fri, Feb 27, 2009 at 1:59 PM, John Brett <[email protected]>
wrote:
> 
> > Perhaps I should explain. The server received fragments of text which
is
> > appended to and XML file. Sometimes the server hung and the log file
was
> > there for diagnosis but because and incomplete fragment had been
written
> out
> > the file wasn't valid XML.
> >
> > I wish I'd known about XML fragment documents at the time.
> >
> > Sent from my iPhone
> >
> >
> > On 27 Feb 2009, at 18:19, Mont Rothstein <[email protected]>
> wrote:
> >
> >  John,
> >>
> >> Thanks for the feedback and info.
> >>
> >> Do you have any insight into what was causing the failures?  Our logs
are
> >> unlikely to be anything close to 10 MB in size.
> >>
> >> Thanks,
> >> -Mont
> >>
> >>
> >> On Thu, Feb 26, 2009 at 11:41 PM, John Brett <[email protected]
> >> >wrote:
> >>
> >>  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
> >>>
> >>>
> >> ===================================
> >> 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
> >
> 
> ===================================
> 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