logging-log4cxx-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jw...@ilstechnology.com
Subject Re: timezone: TZ not defined!
Date Mon, 24 Jan 2005 15:42:08 GMT

Allen,

I recently hit this problem as well in log4cxx 0.9.7.  The solution I used
was to specify the timezone in the log4cxx.properties file.  You can
specify it for a layout like this:

log4j.appender.AuditAppender.layout.TimeZone=America/New_York

After that all my logs magically printed in the specified time zone,
remember you will need one of these stanzas for each appender.  When
looking at the log4cxx source for 0.9.7, they explicitly clear the
timezone.

Hope this helps,

James Wert Jr.
JWert@ILSTechnology.com

Origonal message:

Hello,

Well, I can't get the timezone thing to work at all on my Debian linux
(linux 2.2.20, g++ 3.3.4, log4cxx  0.9.7). Not only can't I get the logger
to output stuff with the right timestamps but while trying to determine why
I have a problem I ran into this strange behaviour...

I write a small program that doesn't use log4cxx at all. It just takes a
look at the value of the environment variable TZ.

If I link with liblog4cxx.so there is a dependency (ldd tells me so - this
is perhaps normal...) and the program tells me that TZ is not set.

If I link without the library (which, of course, is not used by my program
at all) the program tells me that TZ is set.

I can just about live with wrong timestamps, but living with this is a
little hard! What is going on? Any ideas - good, bad, or trivial?

regards Allen





Mime
View raw message