Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Log file in xml format: bad idea?

843834Jan 31 2002 — edited Jan 31 2002
Hey

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
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Feb 28 2002
Added on Jan 31 2002
2 comments
247 views