Re: [Exim] TZ logging buglet

Página superior
Eliminar este mensaje
Responder a este mensaje
Autor: Philip Hazel
Fecha:  
A: Jim Knoble, Anand Buddhdev
Cc: exim-users, Jeffrey Goldberg
Asunto: Re: [Exim] TZ logging buglet
On Mon, 21 Feb 2000, Jim Knoble wrote:

> På 2000-Feb-21 klokka 09:25:40 +0000 skrivet Philip Hazel:
>
> : I don't want to just ignore time-zone information, as that would make
> : all Exim times GMT, which is not nice.
>
> Why not? As long as the log were to say `GMT' or `UTC' or something
> equivalent, i think it would be preferable.


Sites whose daily logs exceed 10MB would not thank me for adding even
as little as 3 characters to every log line.

> Everything ought to log in
> at least UTC, or preferably something like TAI
> (http://cr.yp.to/libtai.html).


This is certainly some people's view. As always, I'm prepared to listen
to what other people think, especially people who live in timezones
other than GMT. It would make virtually zero difference to me to change
Exim to work in GMT, but if I were living in Australia, say, I would be
unhappy if all times in email were GMT/UTC/TIA rather than local time.

What do other people think?

There was a discussion about this on some newsgroup or mailing list some
time ago. There is clearly a set of people who want a standard time, and
an equally committed group who want local time. I find it useful in mail
I receive to have an indication of the timezone of the sender. ("Oh,
it's gone midnight over there - I needn't rush to reply, even though
it's fairly urgent." Or if somebody says "tomorrow" or "yesterday" you
have a vague idea of when they mean.) For those reasons, I prefer the
times in messages and Received: lines to be local time followed by a
numerical offset. I also believe this is helpful to non-expert users.

Logs, I suppose, could be arguably different, though I'd hate to have
logs that were rotated daily at midnight in fact containing times on
different days, but as I say, it wouldn't affect me much.

On Mon, 21 Feb 2000, Anand Buddhdev wrote:

> On Mon, Feb 21, 2000 at 09:25:40AM +0000, Philip Hazel wrote:
>
> > I don't want to just ignore time-zone information, as that would make
> > all Exim times GMT, which is not nice.
>
> Well, if you do logging and received-header timestamps in UTC, your code
> will also be a bit smaller and simpler, and simpler means easier to code
> and work with, and less bugs.


The code isn't exactly very large at present. Here is the code to
generate a log time-stamp:

time_t now = time(NULL);
struct tm *t = localtime(&now);
(void) sprintf(timebuf, "%04d-%02d-%02d %02d:%02d:%02d",
1900 + t->tm_year, 1 + t->tm_mon, t->tm_mday,
t->tm_hour, t->tm_min, t->tm_sec);

I don't think there is much simplification that could happen there!

-- 
Philip Hazel            University of Cambridge Computing Service,
ph10@???      Cambridge, England. Phone: +44 1223 334714.