Why are my Apache Tomcat Log Time Stamps out of sync with my other systems / applications?

Document ID : KB000013420
Last Modified Date : 14/02/2018
Show Technical Document Details
Introduction:

In the process of debugging some problems, CA Support may have you looking at several different logs on your system - some from Web Viewer (application logs), some from DRAS and/or CCI, and others from your Web Application Server (WAS), either Apache Tomcat or IBM WebSphere. If using Tomcat, you may notice the time marked for a specific event in a Tomcat log may be off several hours from the same event in all of the other application and task logs. 

Question:

Why are my Apache Tomcat Log Time Stamps out of sync with those of my other tasks / systems / applications?

Environment:
all
Answer:

This is due to Java defaulting to Greenwich Mean Time (GMT).  For example, Tomcat running on US Eastern Time (EST) will be logged in Tomcat with time stamps five hours later than local time (to the server).

Additional Information:

You can over-ride this Java setting -Duser.timezone=VALUE

For example, for US East coast...

 

-Duser.timezone=America/New_York

More specifically, update the Tomcat task (mainframe) adding this record. We suggest after the -Dfile.encoding= record.

 

 IJO="$IJO -Duser.timezone=America/New_York"

 

For US West coast, use value "America/Los_Angeles".

 

For Tomcat started via other methods (Service or SH script), just look for wherever you set the JVM values such as the memory settings.