Discussion:
[squid-users] logformat %tl and %tg are same.
Mimiko
2017-01-12 07:43:40 UTC
Permalink
Hello.

I use Squid Cache: Version 3.1.20

In order to view the log in a readable format I use this:

logformat squid %{%Y/%m/%d %H:%M:%S}tl %ts.%03tu %6tr %>a %Ss/%03>Hs
%<st %rm %ru %un %Sh/%<A %mt

The problem is that the time in log is in GMT despite of %tl option.
Server is configured to local time. Squid for both, %tl and %tg, shows
same time.

What could be the problem?
Amos Jeffries
2017-01-12 11:27:39 UTC
Permalink
Post by Mimiko
Hello.
I use Squid Cache: Version 3.1.20
logformat squid %{%Y/%m/%d %H:%M:%S}tl %ts.%03tu %6tr %>a %Ss/%03>Hs
%<st %rm %ru %un %Sh/%<A %mt
The problem is that the time in log is in GMT despite of %tl option.
Server is configured to local time. Squid for both, %tl and %tg, shows
same time.
What could be the problem?
The problem is very probably that "Server is configured to local time".

Local time is a political value decided by your countries government,
politicos get to change it whenever they please. And some countries do
play around with it for ridiculous reasons - mine for example changed
local daylight savings time recently so the national sports game can be
played during daylight and broadcast "outside of work hours". So
essentially what time our whole country sees now depends on the
corporate owners of sports stadiums deciding when the games occur. :-(

Internet connected machinery (ie everything nowdays) is supposed to be
using UTC. It would not be a good situation for two adjacent machines to
display for example, ping times of 12hrs just because their admin wanted
different _displays_ on their calendar applications (eg maintained by
people in different countries).

By setting your server to use "local time" (whatever that may be for
you) you are making it tell Squid that GMT == local time.

Your proxy is probably also getting very confused about cacheability of
things because the objects timestamps delivered are always off by
whatever your governments local timezone differential is.


The right thing to do is make your machines operate with UTC and only
use local time for *display* purposes to humans.

Amos
Mimiko
2017-01-12 11:40:22 UTC
Permalink
Post by Amos Jeffries
The problem is very probably that "Server is configured to local time".
By setting your server to use "local time" (whatever that may be for
you) you are making it tell Squid that GMT == local time.
Ok. I understand your point. But why squid shows time in log in GMT? All
other applications log ok, only squid logs time as if server's local
time was configured to GMT.
Amos Jeffries
2017-01-12 13:01:35 UTC
Permalink
Post by Mimiko
Post by Amos Jeffries
The problem is very probably that "Server is configured to local time".
By setting your server to use "local time" (whatever that may be for
you) you are making it tell Squid that GMT == local time.
Ok. I understand your point. But why squid shows time in log in GMT? All
other applications log ok, only squid logs time as if server's local
time was configured to GMT.
Not sure, and 3.1 is so obsolete a version I'm not even able to test it
anymore.

FWIW; I am not seeing your problem on the current Squid versions. %tl
and %tg show different values. Though I do have my machine set to
operate in UTC properly.

Amos

Loading...