syslog-ng is recording the date as
2004-11-05T14:21:17+1000
Which is wrong; it should be
2004-11-05T14:21:37+1100
as `date --iso-8601` returns. What gives?
On Fri, 2004-11-05 at 04:24, scott wrote:
syslog-ng is recording the date as
2004-11-05T14:21:17+1000
Which is wrong; it should be
2004-11-05T14:21:37+1100
as `date --iso-8601` returns.
What gives?
Hmm.. your system-wide timezone setting might have problems. what platform are you using? syslog-ng uses the following function to calculate the timezone offset: static size_t format_tzofs(char *dest, size_t left, struct tm *tm) { size_t length; #if HAVE_GLOBAL_TIMEZONE length = snprintf(dest, left - 1, "%c%02ld%02ld", timezone > 0 ? '-' : '+', (timezone < 0 ? -timezone : timezone) / 3600, (timezone % 3600) / 60); #else length = strftime(dest, left -1, "%z", tm); #endif return length; } -- Bazsi
Hmm.. your system-wide timezone setting might have problems. what platform are you using?
Debian Linux; one Testing (syslog-ng v1.6.4-1), one Unstable (syslog-ng v1.6.4-2).
What version of glibc? What is your local timezone set to? On Fri, 05 Nov 2004 22:06:16 +1000, scott <syslogng@slittle.com> wrote:
Hmm.. your system-wide timezone setting might have problems. what platform are you using?
Debian Linux; one Testing (syslog-ng v1.6.4-1), one Unstable (syslog-ng v1.6.4-2).
_______________________________________________ syslog-ng maillist - syslog-ng@lists.balabit.hu https://lists.balabit.hu/mailman/listinfo/syslog-ng Frequently asked questions at http://www.campin.net/syslog-ng/faq.html
Hmm.. your system-wide timezone setting might have problems. what platform are you using?
Debian Linux; one Testing (syslog-ng v1.6.4-1), one Unstable (syslog-ng v1.6.4-2).
What version of glibc? What is your local timezone set to?
libc6 2.3.2.ds1-18 GNU C Library: Shared libraries and Timezone /etc/timezone is Australia/Sydney. +1000 is standard time, but we're now in DST, so it should be +1100. The only workaround would be to log a plain Unix timestamp and convert later, but there doesn't seem to be a macro for that...
scott-- We had some timezone issues awhile back... So I thought I could help here, but now it appears you have a different problem, so all I can offer is outside advice: * Do you have a local environmental variable in your user account for TZ? * Balazs may know better, but maybe you could force the function "length = strftime(dest, left -1, "%z", tm);" as opposed to HAVE_GLOBAL_TIMEZONE... in the timezone checking part of the code above? - You can check in your config.log if this was set... ? On my relatively up to date gentoo box it was set. On Fri, 12 Nov 2004 16:18:40 +1000, scott <syslogng@slittle.com> wrote:
Hmm.. your system-wide timezone setting might have problems. what platform are you using?
Debian Linux; one Testing (syslog-ng v1.6.4-1), one Unstable (syslog-ng v1.6.4-2).
What version of glibc? What is your local timezone set to?
libc6 2.3.2.ds1-18 GNU C Library: Shared libraries and Timezone
/etc/timezone is Australia/Sydney. +1000 is standard time, but we're now in DST, so it should be +1100.
The only workaround would be to log a plain Unix timestamp and convert later, but there doesn't seem to be a macro for that... _______________________________________________
syslog-ng maillist - syslog-ng@lists.balabit.hu https://lists.balabit.hu/mailman/listinfo/syslog-ng Frequently asked questions at http://www.campin.net/syslog-ng/faq.html
* Do you have a local environmental variable in your user account for TZ?
No; if there was, `date` and various other programs would be off as well. The init script is clean too, though I tried starting it directly from a prompt anyway just to be sure.
* Balazs may know better, but maybe you could force the function "length = strftime(dest, left -1, "%z", tm);" as opposed to HAVE_GLOBAL_TIMEZONE... in the timezone checking part of the code above? - You can check in your config.log if this was set... ? On my relatively up to date gentoo box it was set.
It's Debian, so the packages are precompiled. I'll see how compiling from scratch goes...
"length = strftime(dest, left -1, "%z", tm);" as opposed to HAVE_GLOBAL_TIMEZONE... in the timezone checking part of the code above? - You can check in your config.log if this was set... ? On my relatively up to date gentoo box it was set.
Well, compiling from scratch has the same result. HAVE_GLOBAL_TIMEZONE is set. I'd rather not mess with the source, as that will just be a PITA for upgrades.
On Sat, 2004-11-13 at 03:17, scott wrote:
"length = strftime(dest, left -1, "%z", tm);" as opposed to HAVE_GLOBAL_TIMEZONE... in the timezone checking part of the code above? - You can check in your config.log if this was set... ? On my relatively up to date gentoo box it was set.
Well, compiling from scratch has the same result.
HAVE_GLOBAL_TIMEZONE is set. I'd rather not mess with the source, as that will just be a PITA for upgrades.
I think it's still worth the work as if there's a problem with the timezone based offset calculation which is not present in the other case then I might fix it so you won't have problems with upgrades :) -- Bazsi
I think it's still worth the work as if there's a problem with the timezone based offset calculation which is not present in the other case then I might fix it so you won't have problems with upgrades :)
Yep, it works properly with HAVE_GLOBAL_TIMEZONE off. So does it expect a TZ environemnt variable by default? I haven't seen one of those since the DOS days.
On Mon, 2004-11-15 at 10:45, scott wrote:
I think it's still worth the work as if there's a problem with the timezone based offset calculation which is not present in the other case then I might fix it so you won't have problems with upgrades :)
Yep, it works properly with HAVE_GLOBAL_TIMEZONE off.
So does it expect a TZ environemnt variable by default? I haven't seen one of those since the DOS days.
Thanks. Either the value in timezone is not set properly, or it does not contain the daylight-saving offset, or my code has an error. I'll check (I've checked DST before, and timezone should reflect it, so it _might_ be a problem in libc) I'll see what I can do. -- Bazsi
participants (3)
-
Balazs Scheidler
-
Dave Johnson
-
scott