aspose file tools
The moose likes Other Open Source Projects and the fly likes log4j Asynchronous log message order Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA Java SE 8 Programmer I Study Guide 1Z0-808 this week in the OCAJP forum!
JavaRanch » Java Forums » Products » Other Open Source Projects
Bookmark "log4j Asynchronous log message order" Watch "log4j Asynchronous log message order" New topic
Author

log4j Asynchronous log message order

Ronnie Phelps
Ranch Hand

Joined: Mar 12, 2001
Posts: 329
When using log4j to asynchronously log messages to a local log file, will the order of the log messages be preserved? (i.e. earliest time stamp will always be first and latest will be last)
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 19102
    
    8

I expect that would depend on how you implemented it. Do you have a specific implementation of asynchronous logging you wanted to ask about?
Ronnie Phelps
Ranch Hand

Joined: Mar 12, 2001
Posts: 329
a simple implementation using the following xml to log to the console........

Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 19102
    
    8

Well, the documentation doesn't specify the answer to your question. There's mention of a "buffer" which to me sounds like an orderly queue of messages, but if that isn't enough then you could examine the source code.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: log4j Asynchronous log message order