OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

 


 

   Re: [xml-dev] Appending XML to File

[ Lists Home | Date Index | Thread Index ]

Hi Alan,

> I was wondering if anyone had used XML in a logging context.

To answer the question, I believe that you will find a
good way to manage the data is to store it into a SQL
database in a memo field, along with a datetime entry
stamp and a unique row id.

This will take care of:

 - concurrency issues, if you need it to work from
   multiple machines.

 - programming time, design/code/debugging of what
   is a deceptively simple task (aka all I want is a
   simple system that just...)

 - performance. A free db like mysql might be good
   for a small budget. Consider other products if you
   have more to spend.

 - maintenance and querying. Very easy with sql and
   you get a good choice of languages.

>     Have you wanted to append XML to file, or store XML events to
>     file? How did you do this and manage to keep the document well
>     formed?

I don't know how fast you need the logging to be, your spec didn't
say. What we do to keep it really fast is make sure it can go
in a single TCP/IP packet... and use our whacky compact and fast
xml encoding. ie

EventType&="LogMessage" MachineName&="HP-EPC" LogMessage&="Processing complete"

or go the normal way with something like this:

 <LogEntry>
  <EventType>LogMessage</EventType>
  <MachineName>HP-EPC</MachineName>
  <LogMessage>Processing complete</LogMessage>
 </LogEntry>

Then you save that into the database.

Best Regards

David



----------------------------------------------------------------




 

News | XML in Industry | Calendar | XML Registry
Marketplace | Resources | MyXML.org | Sponsors | Privacy Statement

Copyright 2001 XML.org. This site is hosted by OASIS