Apache Log files timestamp / OS time difference

Apache Log files timestamp / OS time difference

Post by Ni » Fri, 10 Jan 2003 21:25:26



I have noticed that the Apache log file timestamp and OS time(checked
using date OS command )  has some time difference (approximately 13
hrs ) . Any possible reasons for this ?

sample access_log file :
================

- - [08/Jan/2003:04:56:22 -0500] "HEAD / HTTP/1.1" 200 0

OS command:
==========

$date
Wed Jan  8 17:56:25 EAT 2003

Platform: HP-UX unix 11i

 
 
 

Apache Log files timestamp / OS time difference

Post by n.. » Fri, 10 Jan 2003 22:24:25



> I have noticed that the Apache log file timestamp and OS time(checked
> using date OS command )  has some time difference (approximately 13
> hrs ) . Any possible reasons for this ?

Apache logs in UTC.

Quote:> $date
> Wed Jan  8 17:56:25 EAT 2003

EAT is presumably some way off UTC/GMT.

Try this:
        $date -u

Or if that doesn't work on your implementation of UNIX, try this instead:
        TZ=GMT date

These should correspond to the date/time logged by Apache
Chris

until$s[$i];$c=$s[$i];print$c;undef$s[$i];$i=($i+(ord$c))%$l}

 
 
 

Apache Log files timestamp / OS time difference

Post by Ni » Sat, 11 Jan 2003 13:23:30




> > I have noticed that the Apache log file timestamp and OS time(checked
> > using date OS command )  has some time difference (approximately 13
> > hrs ) . Any possible reasons for this ?

> Apache logs in UTC.

> > $date
> > Wed Jan  8 17:56:25 EAT 2003

> EAT is presumably some way off UTC/GMT.

> Try this:
>    $date -u

> Or if that doesn't work on your implementation of UNIX, try this instead:
>    TZ=GMT date

> These should correspond to the date/time logged by Apache
> Chris

Chris --

  If that is the case, how would i Synchronise both the Apache log
timestamp and OS time ?

   I do have few more instances of Apache server on other linux boxes
and When i checked the log files of those ,it matchs exactly with the
OS time (date command)  even though the OS time is not in UTC / GMT.
The default setting holds good.

access_log
-----------

- - [09/Jan/2003:09:48:37 +0530] "HEAD / HTTP/1.1" 200 0

$date

Thu Jan  9 09:48:53 IST 2003

Any comments on this ?

 
 
 

Apache Log files timestamp / OS time difference

Post by n.. » Sat, 11 Jan 2003 18:48:09



>> > I have noticed that the Apache log file timestamp and OS time(checked
>> > using date OS command )  has some time difference (approximately 13
>> > hrs ) . Any possible reasons for this ?
>> Apache logs in UTC.
>   If that is the case, how would i Synchronise both the Apache log
> timestamp and OS time ?

The OS time *is* the same as Apache time. (Correctly so.)

There are two different concepts here. Apache logs in UTC - which is
what the OS works with. By default you are given local "wall clock" time,
which will be adjusted from UTC depending on what timezone you have got
set up on your system.

This is correct - consider three different users: one is in Guyana
(where there is no daylight savings time adjustment; it's always four
hours behind UTC), one is here in the UK, and one is whereever you are
(India?) Assuming each user had set the TZ variable to indicate their
respective timezones, we would all see a different "wall clock" time
from date and other utilities. At the moment it's 9.27am here (GMT). That
means it's 5.27am in Guyana, and maybe 10.27pm whereever you are. There
are all correct representations of the current OS time (05:27 UTC).

    $ echo "User configured timezone is '$TZ'"; date
    User configured timezone is ''
    Fri Jan 10 09:27:00 GMT 2003
    $ date -u                           # UTC (OS time)
    Fri Jan 10 09:27:01 GMT 2003
    $ TZ=EST date                       # New York
    Fri Jan 10 04:27:02 EST 2003
    $ TZ=GB date                        # UK
    Fri Jan 10 09:27:03 GMT 2003
    $ TZ=GMT4 date                      # Guyana
    Fri Jan 10 05:27:04 GMT 2003

Quote:>    I do have few more instances of Apache server on other linux boxes
> and When i checked the log files of those ,it matchs exactly with the
> OS time (date command)  even though the OS time is not in UTC / GMT.

In that case the servers are set up differently from that which was
intended by design, and are not running on UTC. If this is how you want
to set up your servers then that's fine - after all, they are your
servers. They will not give you proper results, however, if you ever
need to do any multiple timezone work.

Quote:> Thu Jan  9 09:48:53 IST 2003

My system recognises neither EAT nor IST so I can't give you concrete
examples. I presume these are local timezone names for whatever country
and/or region you are in.

Chris

until$s[$i];$c=$s[$i];print$c;undef$s[$i];$i=($i+(ord$c))%$l}

 
 
 

Apache Log files timestamp / OS time difference

Post by Juha Laih » Sun, 12 Jan 2003 03:22:00




>> I have noticed that the Apache log file timestamp and OS time(checked
>> using date OS command )  has some time difference (approximately 13
>> hrs ) . Any possible reasons for this ?

>Apache logs in UTC.

Apache logs in whatever timezone was set in the system environment (either
overall system default, or the TZ environment variable) when Apache was
started. Mostly it's sensible to have this set to either the timezone
where the server (and/or primary administrator) is located, or leave
it at UTC. And the choice can be made just by setting TZ within the
apache startup script - or otherwise ensuring the value of TZ env.var at
the moment when the httpd is started.
--
Wolf  a.k.a.  Juha Laiho     Espoo, Finland

         PS(+) PE Y+ PGP(+) t- 5 !X R !tv b+ !DI D G e+ h---- r+++ y++++
"...cancel my subscription to the resurrection!" (Jim Morrison)
 
 
 

Apache Log files timestamp / OS time difference

Post by n.. » Tue, 14 Jan 2003 18:43:41



>Apache logs in UTC.


Quote:> Apache logs in whatever timezone was set in the system environment
> [...] when Apache was started.

Fair point. I'm so used to starting my daemons in UTC that I forgot this.

Chris

until$s[$i];$c=$s[$i];print$c;undef$s[$i];$i=($i+(ord$c))%$l}

 
 
 

1. apache 2.0 logs files and OS

I have a question about my log file. Below are the three lines from my
log file. The last two lines don't show any information regarding the
operating systems. Any reason why? If apache only recognizes certain
OS, is it possible for you to forward me the list of OS supported by
apache as far as keeping log is concerned?

Thanks much in advanced..

Sam

211.193.51.73 - - [10/Dec/2001:00:00:01 -0500] "GET
/medlineplus/news/fullstory_4904.html HTTP/1.1" 20014988
"http://www.nlm.nih.gov/medlineplus/alternativemedicine.html"
"Mozilla/4.0 (compatible; MSIE 5.5; Windows 98; Win 9x 4.90)"

unknown.Level3.net - - [10/Dec/2001:00:00:05 -0500] "GET /medlineplus/
HTTP/1.0" 200 14519 "-" "Mozilla/4.0 (compatible; Keynote-Perspective
5.0)"

1Cust56.tnt17.tco2.da.uu.net - - [10/Dec/2001:00:00:06 -500] "GET
/medlineplus/ency/article/003421.htm HTTP/1.1" 200 27593 "-"
"BMClient"

2. defunct processes

3. dir timestamps vs dir/file timestamps

4. Solaris editors?

5. Apache 1.3b3 Log File Compression Real-Time

6. I have a BIG, BIG,BIG problem with DOSEMU 0.98.5.

7. HELP ! timestamp in log file ???????

8. talk between UNIX and VMS/VAX....

9. Adding timestamps to log files

10. Modify the timestamp in the log file

11. Replace timestamp in a log file

12. smb'ing a NT resource sets time wrong file timestamp

13. Apache Logs : wrong entries in log files