https://issues.apache.org/bugzilla/show_bug.cgi?id=46616

           Summary: rotatelogs -l uses UTC when calling strftime()
           Product: Apache httpd-2
           Version: 2.2-HEAD
          Platform: All
        OS/Version: All
            Status: NEW
          Keywords: PatchAvailable
          Severity: normal
          Priority: P2
         Component: support
        AssignedTo: [email protected]
        ReportedBy: [email protected]


When using "rotatelogs" with "-l" option and a "%" in filename (triggering
calling strftime to get actual file name), the exploded time information passed
to strftime is in UTC (because apr_time_exp_gmt() is called?)

So using the following line "rotatelogs -l log/%Y-%m-%d 3600" creates log files
properly following DST changes but the names of those files follow UTC values. 

For instance in time zone "Europe/Paris" (GMT+1 with DST) the files end in
localtime at 0:59:59 in winter and 1:59:59 in summer: thus starting today (in
winter) httpd at 0:30:00 will output 30 minutes in a log named "yesterday" then
switch at 1:00:00 to "today's" date.

Since using the "-l" option means something like "use localtime not GMT+offset"
it would be neat to have the log name in localtime as well.

***** rotatelogs.c
  246:
  247:                  apr_time_exp_gmt(&e, tNow);
  248:                  apr_strftime(buf2, &rs, sizeof(buf2), szLogRoot, &e);
***** rotatelogs.new.c
  246:
  247:                  if (use_localtime)
  248:                      apr_time_exp_lt(&e, tNow);
  249:                  else
  250:                      apr_time_exp_gmt(&e, tNow);
  251:                  apr_strftime(buf2, &rs, sizeof(buf2), szLogRoot, &e);
*****


-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to