Tomcat – Timestamp in Tomcat logs is wrong

log-filestimezonetomcat

For some reason, the timestamp in my Tomcat logs is off. The system clock is correct, and set to PST, but the Tomcat logs appear to be using GMT. I haven't been able to find this setting anywhere…hoping someone can shed some light.

Thanks

Best Answer

The JVM might have the wrong timezone set as a default.

Add a JVM option -Duser.timezone=US/Pacific (use the JAVA_OPTS property)

(also do a ps | grep java to look at the JVM command line and see if this option is already set for UTC, perhaps by a configuration setting or environment variable).