Reputation: 1131
We have weblogic appserver running on unix box with our application which uses log4j configured for DailyRollingFileAppender.
When I try "date" command on unix prompt it shows me correct timezone (I am in pacific timezone) but for the same time in log files I can see one hour ahead time.
Like, date command shows "Mon Dec 20 15:10:39 PST 2010" but if I open log file, I can see 20-Dec-2010 16:10:39,773 DEBUG XYZ....
My log4j settings are
log4j.appender.test=org.apache.log4j.DailyRollingFileAppender
log4j.appender.test.DatePattern='.'yyyy-MM-dd
log4j.appender.test.Threshold=DEBUG
log4j.appender.test.ImmediateFlush=true
log4j.appender.test.File=test.log
log4j.appender.test.Append=true
log4j.appender.test.layout=org.apache.log4j.PatternLayout
log4j.appender.test.layout.ConversionPattern=%d{dd-MMM-yyyy HH:mm:ss,SSS} %-5p %C:%L - %m%n
Not sure if unix time is proper PST time what time log4j is using for logging, I dont see any log4j timezone configuration in above settings.
How can I check where my timezone settings are incorrect in weblogic ?
-Rushik.
Upvotes: 1
Views: 3337
Reputation: 21
i just solved this problem on ubuntu,here are the steps 1.use tzselect command confiugre timezone 2.ln -sf /usr/share/zoneinfo/$State/$city /etc/localtime 3.ensure that the "/ etc/timezone" which is you configured to set the timezone 4.reboot
Upvotes: 2
Reputation: 3029
It sounds like your issue is with Daylight Savings Time (DST). If a restart of your application server does not resolve the issue, you may be using an older version of java that does not have the fix for the recent DST change.
If that is the case, you have the option of either updating to a later JDK that has the fix embedded or you could manually apply the DST patch to your existing Java installation.
Upvotes: 0