Bug 63253 - Rotatelogs using yesterday's date in file name on day of daylight savings change
Summary: Rotatelogs using yesterday's date in file name on day of daylight savings change
Status: NEW
Alias: None
Product: Apache httpd-2
Classification: Unclassified
Component: support (show other bugs)
Version: 2.4.38
Hardware: PC Linux
: P2 normal (vote)
Target Milestone: ---
Assignee: Apache HTTPD Bugs Mailing List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-03-10 15:32 UTC by Geoff Mottram
Modified: 2023-03-28 23:37 UTC (History)
0 users



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Geoff Mottram 2019-03-10 15:32:40 UTC
Hi,

I restarted my apache instance today (3/10/2019) and the log file name being generated is from yesterday (3/9/2019). I am using local time and rotatelogs is being started like this:

    rotatelogs -l access_log.%Y-%m-%d 86400

The file name at 11:AM on Sunday March 10, 2019 (Eastern time) is:

    access_log.2019-03-09

I suspect the problem originates on line 392 of rotatelogs.c:

    tLogStart = (now / config->tRotation) * config->tRotation;

I think this results in the start time being 11:00PM from yesterday instead of midnight, today.

tLogStart is used to format the log file name and today (3/10/2019), the clocks were moved forward, so there is one less hour in the day. I am hoping the problem will fix itself tomorrow when there will have been 24 hours in the day.

Thanks for your contributions to this project.

Geoff
Comment 1 raymondho 2023-03-28 23:37:35 UTC
Looks like the problem is still there. 

With 

rotatelogs -l access_log.%Y-%m-%d 86400

The wrong filename will be used on the day we switch to daylight savings time.

Will the bug be fixed in a future version?