You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4j-user@logging.apache.org by Joerg Eggink <eg...@access-sys-eu.com> on 2003/07/31 18:28:27 UTC
Wrong timezone in logger output
Dear all
I'm using log4j on freebsd4.8 with jdk1.3
If have the following problem.
The timezone seems incorrect for log statements. There is always a
difference from 4 hours.
E.g. current time displayed with "date" command
Thu Jul 31 18:23:22 CEST 2003
But log statement of log4j is
Jul 31 14:23:22
I'm using following date format
%d{MMM dd HH:mm:ss}
I don't know may be it is not related to log4j but if someone has a idea
it would be nice.
Thanks for help in advance
Joerg
---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: log4j-user-help@jakarta.apache.org
Re: Wrong timezone in logger output
Posted by Luis DiazRojas <lu...@ionidea.com>.
Hi Joerg,
Let me tell you my experience it may help you.
Under Solaris I had to set the TZ enviroment variable to make the logger show the correct time.
In a script to run my java programs I had to write:
export TZ=GMT-5
and then execute my java program as always.
Maybe the GMT zone in your OS is incorrect when you run your java program.
Hope this helped you.
Good Luck.
Luis
================= Original message ===============
From: "Joerg Eggink" <eg...@access-sys-eu.com>
To: log4j-user@jakarta.apache.org
Sent: Thu, 31 Jul 2003 18:28:27 +0200
Subject: Wrong timezone in logger output
J> Dear all
J>
J> I'm using log4j on freebsd4.8 with jdk1.3
J> If have the following problem.
J> The timezone seems incorrect for log statements. There is always a
J> difference from 4 hours.
J>
J> E.g. current time displayed with "date" command
J> Thu Jul 31 18:23:22 CEST 2003
J>
J> But log statement of log4j is
J> Jul 31 14:23:22
J>
J> I'm using following date format
J> %d{MMM dd HH:mm:ss}
J>
J> I don't know may be it is not related to log4j but if someone has a idea
J> it would be nice.
J>
J> Thanks for help in advance
J>
J> Joerg
J>
J>
J> ---------------------------------------------------------------------
J> To unsubscribe, e-mail: log4j-user-unsubscribe@jakarta.apache.org
J> For additional commands, e-mail: log4j-user-help@jakarta.apache.org
J>
J>
=============End of Original message =============
---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: log4j-user-help@jakarta.apache.org
Re: Wrong timezone in logger output
Posted by Thomas NGUYEN <th...@openwide.fr>.
On Thu, 2003-07-31 at 18:28, Joerg Eggink wrote:
> Dear all
>
> I'm using log4j on freebsd4.8 with jdk1.3
> If have the following problem.
> The timezone seems incorrect for log statements. There is always a
> difference from 4 hours.
>
> E.g. current time displayed with "date" command
> Thu Jul 31 18:23:22 CEST 2003
>
> But log statement of log4j is
> Jul 31 14:23:22
Log4j is displaying a perfectly valid date, but in the GMT timezone!
You must find a way to tell Java you are in the GMT-4 timezone. Try
tweaking the TZ, LANG or LC_* environnement variable at the shell level.
May be there are some similar variables in java itself (those -D
environnement variables), which I don't know.
>
> I'm using following date format
> %d{MMM dd HH:mm:ss}
>
> I don't know may be it is not related to log4j but if someone has a idea
> it would be nice.
>
> Thanks for help in advance
>
> Joerg
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: log4j-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: log4j-user-help@jakarta.apache.org
--
Thomas
---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: log4j-user-help@jakarta.apache.org