aspose file tools*
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


Win a copy of Spring in Action this week in the Spring forum!
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: 113
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
Bartender

Joined: Oct 14, 2005
Posts: 18651
    
    8

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 agree. Here's the link: http://aspose.com/file-tools
 
subject: log4 order of log line on the same milisecond?