Re: problem with rotatelogs time of day formatting

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 01.10.2011 05:20, Albert Lunde wrote:
> The date substitutions are working, but the time of day characters come
> out as zeros. An example, and some system information, are quoted below.

> ErrorLog "|/usr/local/sbin/rotatelogs -f
> /var/log/httpd/error_log_chnuinfow3.%Y-%m-%d-%H_%M_%S.txt 86400"
> 
> [root@chnuinfow3 conf]# ls -1 /var/log/httpd
> access_log_chnuinfow3.2011-09-30-00_00_00.txt
> access_log_chnuinfow3.2011-10-01-00_00_00.txt
> access_log_skipped_chnuinfow3.2011-09-30-00_00_00.txt
> access_log_skipped_chnuinfow3.2011-10-01-00_00_00.txt
> error_log_chnuinfow3.2011-09-30-00_00_00.txt
> error_log_chnuinfow3.2011-10-01-00_00_00.txt

The timestamp used for the file names is always the previous point in
time where rotation would have happended. You configured a daily
rotation pattern (86400 seconds). By default it rotates at midnight in
GMT timeone, or using the local timezone if rotatelogs is used with the
flag "-l".

So I guess either your system runs on GMT, or you used "-l". With 86400
rotation always happens at midnight (GMT or localtimewith -l) and the
time 00:00:00 is correct. Note that even the new files created when you
start Apache will have the formatted timestamp for the "previous point
in time where rotation would have happended", so when using 86400 it
would be last midnight (relative to GMT or localtimewhen using -l).

Try using a very different interval, like e.g. "90" and observe, whether
the files rotate every 90 seconds and now produce more interesting
formatted timestamps.

Regards,

Rainer

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@xxxxxxxxxxxxxxxx
   "   from the digest: users-digest-unsubscribe@xxxxxxxxxxxxxxxx
For additional commands, e-mail: users-help@xxxxxxxxxxxxxxxx



[Index of Archives]     [Open SSH Users]     [Linux ACPI]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Squid]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]

  Powered by Linux