Ask Questions and Find Answers
Important:
Ask is now read-only. You can review any existing questions and answers, but not add anything new.
But - don't panic! While ask is no more, we've replaced it with discuss - the new Liferay Discussion Forum! Read more here here or just visit the site here:
discuss.liferay.com
RE: how to change system timezone
hi
i changed timezone from control panel > instance settings > localization > virtual instance scope > timezone
but the log print out still use gmt timezone, it will make me harder to tracing issue.
is there anyway to change timezone?
i found in property company.default.time.zone from server administration > properties > portal properties
but i don't know how to change it, in portal-ext.properties? or in portal-setup-wizard.properties than restart server?
thanks in advance
The time zone configured at instance level (control panel > instance settings > localization > virtual instance scope > timezone) only applies to the user interface for the new created users.
If you want to change the timezone of the log traces, you have to
change the portal-log4j.xml
configuration.
Here there is a HelpCenter article that explains how to configure it Changing the Log Time Zone Without Changing the JVM Time Zone (it will need a HelpCenter user)
Important, never set the time zone at JVM level, as it can cause Liferay issues, see these HelpCenter articles: Issues With Setting Time Zone Settings on the JVM Level and Can I change the JVM Time Zone?
Hi there,
I changed my portal-log4j-ext.xml as suggested
<appender name="CONSOLE" class="org.apache.log4j.ConsoleAppender">
<layout class="org.apache.log4j.EnhancedPatternLayout">
<param name="ConversionPattern" value="%d{ABSOLUTE}{EDT} %-5p [%t][%c{1}:%L] %m%n" />
</layout>
</appender>
<appender name="FILE" class="org.apache.log4j.rolling.RollingFileAppender">
<rollingPolicy class="org.apache.log4j.rolling.TimeBasedRollingPolicy">
<param name="FileNamePattern" value="@liferay.home@/logs/liferay@spi.id@.%d{yyyy-MM-dd}.log" />
</rollingPolicy>
<layout class="org.apache.log4j.EnhancedPatternLayout">
<param name="ConversionPattern" value="%d{ABSOLUTE}{EDT} %-5p [%t][%c{1}:%L] %m%n" />
</layout>
</appender>
<root>
<priority value="INFO" />
<appender-ref ref="CONSOLE" />
<appender-ref ref="FILE" />
</root>
Restarted portal. But the log still uses the GMT timezone.
What am I missing?
Thank you.
Alla
Powered by Liferay™