legacy-knowledge-base
公開されました Sep. 10, 2025

Liferay logs Timezone

written-by

Apsara Raheja

How To articles are not official guidelines or officially supported documentation. They are community-contributed content and may not always reflect the latest updates to Liferay DXP. We welcome your feedback to improve How To articles!

While we make every effort to ensure this Knowledge Base is accurate, it may not always reflect the most recent updates or official guidelines.We appreciate your understanding and encourage you to reach out with any feedback or concerns.

legacy-article

learn-legacy-article-disclaimer-text

Issue

  • How do change the timezone displayed in the Liferay log files without changing the JVM time zone?

Environment

  • Liferay DXP 7.4 [All updates]
  • Liferay Quarterly Release

Resolution

  • Get a copy of the portal-log4j.xml file by extracting it from the portal-impl.jarfrom [Liferay_HOME]\[Tomcat_HOME]\webapps\ROOT\WEB-INF\shielded-container-lib\portal-impl.jar\META-INF\
  • Rename the copy of the portal-log4j.xml file to portal-log4j-ext.xml
  • Find the below property in portal-log4j-ext.xml
    <Layout pattern="%d{yyyy-MM-dd HH:mm:ss.SSS} %-5p [%t][%c{1}:%L] %m%n" type="PatternLayout"/> 
  • Add Timezone as like below:
    <Layout pattern="%d{yyyy-MM-dd HH:mm:ss.SSS}(TimeZone} %-5p [%t][%c{1}:%L] %m%n" type="PatternLayout"/> 
  • Find the required values for TIME ZONE at http://en.wikipedia.org/wiki/List_of_zoneinfo_timezones.
  • Place the modified portal-log4j-ext.xml file at [Liferay_HOME]/[Tomcat_HOME]/webapps/ROOT/WEB-INF/classes/META-INF
  • Restart the portal.

Additional Information

did-this-article-resolve-your-issue

legacy-knowledge-base