httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Rainer Jung <rainer.j...@kippdata.de>
Subject Re: [users@httpd] problem with rotatelogs time of day formatting
Date Sat, 01 Oct 2011 15:06:22 GMT
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@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Mime
View raw message