KB Article #179595

How to setup trackntraceserver.log to roll over?

Problem

The trackntraceserver.log is setup by default to keep appending without a limit. This causes the log file to grow in size and in turn causes issues with analyzing or investigating for issues.

Resolution

The log4j.properties file which controls the log files for Track and Trace is located at "[TrackAndTrace Install]\server\webapps\trackntraceserver\WEB-INF\classes" directory.

In that file, comment out the line "log4j.appender.File=org.apache.log4j.FileAppender" like this: "#log4j.appender.File=org.apache.log4j.FileAppender", and add the following line "log4j.appender.File=org.apache.log4j.RollingFileAppender" so that the log file format is a rolling file instead of appending to a single file.

Then comment out the "log4j.appender.File.append=true" and add the two lines in the same section like below.

#log4j.appender.File.append=true

log4j.appender.File.MaxFileSize=10MB

log4j.appender.File.MaxBackupIndex=100

Now, save changes to the log4j.properties and restart the TNT server for these changes to take effect.

You will notice that the log file will now roll over to a new file every time it reaches 10MB and it will maintain a maximum of 100 log files for the Track and Trace server.