You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Steve Foster <st...@gmail.com> on 2011/04/06 14:03:42 UTC

[users@httpd] Rotatelogs and british summertime.

Hi there,

I have a slight issue with rotatelogs and british summer and wintertime.

When in BST my logfile entries are being written with the correct timestamp
(localised) but the logfile rotation filename does not match the current
time,

e.g i set my logfile name as
/opt/app/apache2.2.17/logs/steve_access_log.%Y-%m-%d-%H_%M_%S with a
rotation time of 86400 seconds.

I then end up with a logfile called steve_error_log.2011-04-06-00_00_00 ,
but the first entry is written at 01:00 and not 00:00 as i would expect.

I can work around this by setting my CustomLog setting as follows:
CustomLog "|/opt/app/apache2.2.17/bin/rotatelogs
/opt/app/apache2.2.17/logs/steve_access_log.%Y-%m-%d-%H_%M_%S 86400 *+60*"
ORU_extended

I then end up with the first logfile entry being written at 00:00 and the
last at 23:59.

My concern is though that when we switch back to GMT in October that i will
then have to remove the "+60" from the configuration.

Does anyone in the UK have a better workaround that deals with the switch
between GMT->BST and BST->GMT better without having to resort to
configuration file changes?

Cheers in advance

Steve

Re: [users@httpd] Rotatelogs and british summertime.

Posted by Steve Foster <st...@gmail.com>.
hi rob,

we do have summers, they just don't last very long!!!

Yes normally its started from a startup script and we do specify a TZ
variable, which i've got a feeling is not correct. I'll look into this.

cheers

Steve

On Wed, Apr 6, 2011 at 1:20 PM, Rob De Langhe <ro...@twistfare.be>wrote:

> hey Steve,
>
> didn't know you guys have summers in Britain ?!   ;-)
>
> I would guess your Apache is started either from CRON or in any case from a
> startup script that didn't have the right TZ environment variable set.
>
> Rob
>
> Citeren Steve Foster <st...@gmail.com>:
>
> Hi there,
>  I have a slight issue with rotatelogs and british summer and wintertime.
>  When in BST my logfile entries are being written with the correct
> timestamp (localised) but the logfile rotation filename does not match the
> current time,
>  e.g i set my logfile name as
> /opt/app/apache2.2.17/logs/steve_access_log.%Y-%m-%d-%H_%M_%S with a
> rotation time of 86400 seconds.
>  I then end up with a logfile called steve_error_log.2011-04-06-00_00_00 ,
> but the first entry is written at 01:00 and not 00:00 as i would expect.
>  I can work around this by setting my CustomLog setting as follows:
> CustomLog "|/opt/app/apache2.2.17/bin/rotatelogs
> /opt/app/apache2.2.17/logs/steve_access_log.%Y-%m-%d-%H_%M_%S 86400 *+60*"
> ORU_extended
>  I then end up with the first logfile entry being written at 00:00 and the
> last at 23:59.
>  My concern is though that when we switch back to GMT in October that i
> will then have to remove the "+60" from the configuration.
>  Does anyone in the UK have a better workaround that deals with the switch
> between GMT->BST and BST->GMT better without having to resort to
> configuration file changes?
>  Cheers in advance
>  Steve
>
>
>
> ----------------------------------------------------------------
> This message was sent using IMP, the Internet Messaging Program.
>

Re: [users@httpd] Rotatelogs and british summertime.

Posted by Rob De Langhe <ro...@twistfare.be>.

hey Steve, 

didn't know you guys have summers in Britain ?!   ;-) 

I would guess your Apache is started either from CRON or in any case from a startup script that didn't have the right TZ environment variable set. 

Rob

Citeren Steve Foster <st...@gmail.com>: 

> Hi there, 
>
> I have a slight issue with rotatelogs and british summer and wintertime.  
>
> When in BST my logfile entries are being written with the correct timestamp (localised) but the logfile rotation filename does not match the current time, 
>
> e.g i set my logfile name as /opt/app/apache2.2.17/logs/steve_access_log.%Y-%m-%d-%H_%M_%S with a rotation time of 86400 seconds. 
>
> I then end up with a logfile called steve_error_log.2011-04-06-00_00_00 , but the first entry is written at 01:00 and not 00:00 as i would expect. 
>
> I can work around this by setting my CustomLog setting as follows: 
> CustomLog "|/opt/app/apache2.2.17/bin/rotatelogs /opt/app/apache2.2.17/logs/steve_access_log.%Y-%m-%d-%H_%M_%S 86400 +60" ORU_extended 
>
> I then end up with the first logfile entry being written at 00:00 and the last at 23:59. 
>
> My concern is though that when we switch back to GMT in October that i will then have to remove the "+60" from the configuration. 
>
> Does anyone in the UK have a better workaround that deals with the switch between GMT->BST and BST->GMT better without having to resort to configuration file changes? 
>
> Cheers in advance 
>
> Steve



----------------------------------------------------------------
This message was sent using IMP, the Internet Messaging Program.

Re: [users@httpd] Rotatelogs and british summertime.

Posted by Eric Covener <co...@gmail.com>.
> I am not sure whether the TZ variable is being set on the execution
> of the rotatelogs script that is spawned from the httpd.

I don't think it has any effect without -l, since the date in the
filename would be UTC.

---------------------------------------------------------------------
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


Re: [users@httpd] Rotatelogs and british summertime.

Posted by Steve Foster <st...@gmail.com>.
You would assume so, but the guidance in the documentation says the
following:

"Causes the use of local time rather than GMT as the base for the interval
or for strftime(3) formatting with size-based rotation. Note that
using -lin an environment which changes the GMT offset (such as for
BST or DST) can
lead to unpredictable results!"

We used this a while ago and removed it when we realised it didn't work
correctly. Currently setting a TZ variable in startup scripts (/etc/init.d
type scripts) to GMT0BST,M3.5.0/1,M10.5.0/1 results in the right timings
being applied to the access logs in BST , the log rotation is still offset
though. I am not sure whether the TZ variable is being set on the execution
of the rotatelogs script that is spawned from the httpd.

Steve
On Wed, Apr 6, 2011 at 1:39 PM, Eric Covener <co...@gmail.com> wrote:

> > My concern is though that when we switch back to GMT in October that i
> will
> > then have to remove the "+60" from the configuration.
>
> Isn't that what -l does for you?
>
> ---------------------------------------------------------------------
> 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
>
>

Re: [users@httpd] Rotatelogs and british summertime.

Posted by Eric Covener <co...@gmail.com>.
> My concern is though that when we switch back to GMT in October that i will
> then have to remove the "+60" from the configuration.

Isn't that what -l does for you?

---------------------------------------------------------------------
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