Re: how to log date/time in daemon mode?
Peter Pentchev <[email protected]>
| Newsgroups | gmane.mail.fetchmail.user |
|---|---|
| Message-ID | <[email protected]> |
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
--
Peter Pentchev roam@{ringlet.net,debian.org,FreeBSD.org} [email protected]
PGP key: http://people.FreeBSD.org/~roam/roam.key.asc
Key fingerprint 2EE7 A7A5 17FC 124C F115 C354 651E EFB0 2527 DF13
_______________________________________________
Fetchmail-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/fetchmail-users
signature.asc
(application/pgp-signature, 833 B)
-----BEGIN PGP SIGNATURE----- iQIzBAABCAAdFiEELuenpRf8EkzxFcNUZR7vsCUn3xMFAluwqzwACgkQZR7vsCUn 3xMRCxAAzNx2qnuw7M/twnyG0AnyMsdsF02v2jK+uMGZHFD5qexcLrueSgmEXiI5 DseBEQup6GBZ1CXY7/mnrxlQyRLALO8N2anixoGtgiYBNXJ4a3A9eRgjykzXPV7t qmVAHy6BCrOiFgKGY/iWdrdfXTszCR0RasDY4h2H2HfmMlLDcMo9Pz86Nm+/4zA8 gfceu0B8F25qjJePbusO5ywz/JpkN7pySt69Gyx0n1Fh7GsS4BcPcY2y25V0OJE0 0eUaZCyaNAqkiCxfQVpUTE17k0wvCNJUYf1KoDbS2LcK7/mmCamjXsnaQD/f0M5J gXL9vzFOy2T5SFmsADCioJKRlE3ylpVl9SVp2Wr1kkAhQZIpvaIsRDJWVEj/tjDG av4nmsLrjIH/2kX2kiqxYDwNORT3eM72CFrw7yL4pKbjbM5jPCg5m1E1cRqAxBVL U4Opkz3yYfGKRbW2AqqjL/UcWIzksHPZS3ZxNVAcosq4a/ioYftOzSvG7cwoklE7 etVBcvnsuFwT4TuDgwcZXifLokyzH8QJncqQdKNpxrd+zMUyJlMLBSsoD0UKccGD xFHLpnpVIRXjnlMfavh8a4FjDv3kq05g3N061QyWeH13EXkQ/k1BInP2ZtQoYpvg HqtXI/lUodHvrKMXibL0FM7h5lTcIAirxCupZaNUPW/HKDvyne4= =4sqd -----END PGP SIGNATURE-----