Forums Register Login

log4 order of log line on the same milisecond?

+Pie Number of slices to send: Send
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.
+Pie Number of slices to send: Send
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.
CLUCK LIKE A CHICKEN! Now look at this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com


reply
reply
This thread has been viewed 467 times.
Similar Threads
what's with the ThreadDeath
EJB Overhead and Performance
Java Date andMS SQL sever datetime comparasion problem
static synchronized method in a StatelessSessionBean
Issue regarding Executing Thread
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 29, 2024 02:50:30.