Log file in xml format: bad idea?
843834Jan 31 2002 — edited Jan 31 2002Hey
Im trying to write a class that will let other classes keep a log on whatever they want to. Whoever wants to write a message to a log file will call a function there, with the specified log name and the message, and my class will write it in xml format into the file.
Simple right? But here's the catch: in order to append a log into the file, I have to read it all first, then create the Element and add it to the root element. That meens that as the file grows, so will the time it takes to read it, and eventually log will take loads of time...
All this would not have happen otherwise, with simple text files, as all I have to do is to open the file for appending, which wouldn't take that much time.
So my questions are: Am I stupid to think this is possible with xml? Should I open the xml file as text file and then manipulate it? Are there any other possibilities?
Thanks for your help - Uzi