aspose file tools*
The moose likes Java in General and the fly likes logging parallel threads Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "logging parallel threads" Watch "logging parallel threads" New topic
Author

logging parallel threads

Dorothy Taylor
Ranch Hand

Joined: Nov 26, 2007
Posts: 104
Hi

I want to create a log file in an xml format. I want to know that if there are many parallel threads updating(insert, edit, delete) in this file, can we ensure the integrity of the structure of the xml file? Can we use log4j for this?
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18541
    
    8

Of course. Have the logging done by a single object, which all of the threads use, and have the logging done in a synchronized method.
Dorothy Taylor
Ranch Hand

Joined: Nov 26, 2007
Posts: 104
Thanks for the answer. Is it possible to have a custom structure for this xml log file using log4j?
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: logging parallel threads