Log4j log file timestamps are out of order, can I fix it?

Asked By 0 points N/A Posted on -
qa-featured

 

I have worked with several applications in Java. Log 4j is one of that.  At this moment my Log4j log file timestamps are out of order, can I fix it? While fixing how can I follow the steps?

SHARE
Answered By 30 points N/A #171618

Log4j log file timestamps are out of order, can I fix it?

qa-featured

 

Hi there,
 
This happens when the user is running multiple threads or two different processes logging into the same log file with the rolling appender. 
 
Logging multiple processes to the same log is not allowed in Log4j and whenever you try to do that you'll get a messy log.
 
Since you haven't given us any details about what processes you are running, I can't give you the exact step by step instructions how to set up different logs for each process, but the basic procedure is quite simple – if you are running different servers, add a server names to the log files in a clustered web app and configure each server to write their own logs. If you have two applications trying to write logs to the same log file, just name the files depending on the application you are running.
 

Related Questions