You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Log::Log4perl::DateFormat computes the time zone offset only once, so Lo4perl ends up logging incorrect datetimes when the object survives during time zone changes.
% faketime '2021-03-28 01:59:58' perl -MLog::Log4perl -E 'sub g {Log::Log4perl::DateFormat->new("yyyy-MM-ddTHH:mm:ss.SSSZ")}; my $outer = g(); for (1..5) { say join " ", $outer->format(time), g->format(time); sleep 1 }'
2021-03-28T01:59:58.000+0100 2021-03-28T01:59:58.000+0100
2021-03-28T01:59:59.000+0100 2021-03-28T01:59:59.000+0100
2021-03-28T03:00:00.000+0100 2021-03-28T03:00:00.000+0200
2021-03-28T03:00:01.000+0100 2021-03-28T03:00:01.000+0200
2021-03-28T03:00:02.000+0100 2021-03-28T03:00:02.000+0200
The text was updated successfully, but these errors were encountered:
How expensive is it to look up the timezone offset? If it's cheap, it should be just not cached. If it's expensive, then this should be documented in e.g. an FAQ (so that a rolling restart of logging could be scheduled at TZ switch time). How do other logging daemons/libraries deal with this?
Log::Log4perl::DateFormat
computes the time zone offset only once, so Lo4perl ends up logging incorrect datetimes when the object survives during time zone changes.The text was updated successfully, but these errors were encountered: