You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4cxx-user@logging.apache.org by re...@rubixinfotech.com on 2004/09/01 18:40:24 UTC

Log4cxx obliterates the TZ setting...

We have some code which started behaving strange after going to log4cxx 
for logging... I've isolated it down to the fact that log4cxx obliterates 
the TZ settings in timezone.cpp and dailyrollingfileappender.cpp

Questions:
        Instead of changing to GMT to calculate the diff, why not use 
gmtime() or gmtime_r()? 
                - I've done this in our code that had to calculate this 
difference for a LogFile class that dates back almost 8 years...
                - This way there is not "side-effect"...
        *IF* I change the code to work that way, any chance of having it 
included in the 'official' package?

I also noticed that on Solaris using CC, if I compile the whole thing 
after a "make clean", it works.  But then if I go change a file & 
recompile... it doesn't work.  Looks like the problem is in the 'cache' 
files that Sun's CC uses for templates.... somehow during the build 
process, those files are either deleted or overwritten... and the next 
time, when you change a single file & compile... the linker cannot file a 
bunch of templates...

Regards 

Renny Koshy
President & CEO

--------------------------------------------
RUBIX Information Technologies, Inc.
www.rubixinfotech.com

Re: Log4cxx obliterates the TZ setting...

Posted by Curt Arnold <ca...@apache.org>.
I had noticed the potential for the problem and logged it as 
http://nagoya.apache.org/jira/browse/LOGCXX-11.  Thanks for confirming 
that is actually a problem.  My suspicion is that gmtime or gmtime_r is 
not adequate since log4cxx may need to format times to a time-zone 
other than the current time zone.  However, it might be an optimization 
if the timezone for the layout and the current timezone are the same.  
I guess the first thing is to at least reset the value of TZ to the 
initial value after collecting time zone offsets.


On Sep 1, 2004, at 11:40 AM, renny.koshy@rubixinfotech.com wrote:

>
> We have some code which started behaving strange after going to 
> log4cxx for logging... I've isolated it down to the fact that log4cxx 
> obliterates the TZ settings in timezone.cpp and 
> dailyrollingfileappender.cpp
>
> Questions:
>         Instead of changing to GMT to calculate the diff, why not use 
> gmtime() or gmtime_r()?
>                 - I've done this in our code that had to calculate 
> this difference for a LogFile class that dates back almost 8 years...
>                 - This way there is not "side-effect"...
>         *IF* I change the code to work that way, any chance of having 
> it included in the 'official' package?