Bug 46046 - Date conversion in PatternLayout does not follow changes to default time zone
Date conversion in PatternLayout does not follow changes to default time zone
Status: RESOLVED FIXED
Product: Log4j
Classification: Unclassified
Component: Layout
1.2
PC Mac OS X 10.4
: P2 normal
: ---
Assigned To: log4j-dev
:
Depends on:
Blocks:
  Show dependency tree
 
Reported: 2008-10-20 15:56 UTC by Curt Arnold
Modified: 2009-01-08 10:23 UTC (History)
0 users



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Curt Arnold 2008-10-20 15:56:15 UTC
List:       log4j-user
Subject:    Timestamps and time zones
From:       "Peter Steele" <psteele () maxiscale ! com>
Date:       2008-10-19 20:12:27


We've noticed somewhat undersirable logging behavior when we change the
time zone our appllicaton is running under. When the application starts,
the timestamps used in our log files match the current local time,
albeit without an explicit time zone identifier included in the time,
but that's okay. However, if we change the time zone, e.g. from 8:00 am
PDT to 8:00 am EDT, while the local time simply starts displaying the
new time zone identifier, the log timestamps get shifted by the
difference in the time zones. In this specific case, the log timestamps
would get shifted to 5:00 am.

 

If we then stop and restart the application, the timestamps are then
based again on the local time (8:00 am instead of 5:00 am). This is what
we want of course, but we want this to happen dynamically as well and
not have to restart the application to get the timestamps in sync with
the local time. How can we accomplish this? We want the timestamps to
match whatever the local time is, regardless of the time zone, even
after a time zone change. Is there a logger call we can make?

Thread continues at http://marc.info/?l=log4j-user&m=122444718829901&w=2
Comment 1 Curt Arnold 2009-01-08 10:23:57 UTC
Committed fix to extras EnhancedDateFormat in rev 706445 and 706451.