N/APosted on - 01/31/2013
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?
Log4j log file timestamps are out of order, can I fix it?
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.