From: Gene H. <ghe...@sh...> - 2018-09-30 13:14:50
|
On Sunday 30 September 2018 06:53:53 Peter Pentchev wrote: > On Sun, Sep 30, 2018 at 04:51:51AM -0400, Gene Heskett wrote: > > On Sunday 30 September 2018 00:58:21 grarpamp wrote: > > > > This makes the log entries look like this: > > > > > > > > fetchmail [2018/09/29 17:04:41]: 2 messages for ... > > > > fetchmail [2018/09/29 17:04:42]: reading message ... > > > > > > > > Here's the patch I used for 6.3.26... > > > > > > Try reading and adopting a valid iso8601 standard format for > > > timestamps instead of the above which are nonconformant > > > and ambiguous in multiple ways. > > > > And whats wrong with the above format? And since I know thats my > > machines local time in a valid 24 hour format, I do not see any > > ambiguity. > > Problems will arise once you try to coordinate logs from different > machines or send these logs to somebody else who has to match them > against logs from their mailserver which may be in a different > timezone - and, unless you tell them what your timezone is, there is > no way they know what time your 17:04:41 is on their side. I have to > deal with something like this with syslog files from machines in > different timezones almost every week :( (and yes, most of the time > I know which timezone which log comes from, but it's still much harder > than it needs to be to combine and process them automatically) > > Another way this is ambiguous is made a lot better by the use of > four digits for the year, but the fact still remains that there are > some areas in the world which actually use a YYYY/DD/MM format, just > as there are still some (very, very weird from my point of view, but > you get the point) areas in the world which still use a MM/DD format > :) The four-digit year removes the MM/DD/YY vs DD/MM/YY vs YY/MM/DD > ambiguity (which I've had to deal with in the past and it was awful), > but, very slim as the chances are for a YYYY/DD/MM vs YYYY/MM/DD one, > it is still better to use a well-known (and recognizable) format to > avoid *any* ambiguities. > > So, yes, I accept the criticism, since in my code snippets I did not > use an ISO 8601 format either; if you really want your logs to be > easy to use for matching against other logs, possibly from other > servers, something like a `date --iso-8601=seconds` (with GNU date) or > passing %Y%m%dT%H:%M:%S%z as a format string to a strftime-like > formatting function would be much preferable. > > G'luck, > Peter And that is essentially the same with an added -0400 which is the local EDT time zone offset from GMT. But since the only person interested in my fetchmail.log is me, it definitely comes under the category of "good enough for the girls I go with." ;-) Patches welcome however. Take care Peter, and thanks for the explanation. -- Cheers, Gene Heskett -- "There are four boxes to be used in defense of liberty: soap, ballot, jury, and ammo. Please use in that order." -Ed Howdershelt (Author) Genes Web page <http://geneslinuxbox.net:6309/gene> |