This week's book giveaway is in the OO, Patterns, UML and Refactoring forum.
We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line!
See this thread for details.
The moose likes Other Open Source Projects and the fly likes log4 order of log line on the same milisecond? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Products » Other Open Source Projects
Bookmark "log4 order of log line on the same milisecond?" Watch "log4 order of log line on the same milisecond?" New topic
Author

log4 order of log line on the same milisecond?

Elhanan Maayan
Ranch Hand

Joined: May 04, 2009
Posts: 136
hi..

we have a multi threaded app which uses rolling file appenders, however, i've noticed that there are times where several different lines may be written on on the same milisecond time signature. and that they may have NOT been executed in the same order they are displayed.

is this possible? how can i make sure the order of writing is maintained with the order of execution.
Paul Clapham
Sheriff

Joined: Oct 14, 2005
Posts: 19720
    
  10

You can't, really. That's because when you have operations which occur in two different threads, it isn't necessarily possible to tell which of them occurred first. Especially when the operations are not atomic, and writing to a log file certainly wouldn't be atomic.
 
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link: http://aspose.com
 
subject: log4 order of log line on the same milisecond?
 
jQuery in Action, 3rd edition