On Jan 2, 2007, at 12:04 PM, Eric Kolotyluk wrote:
I found a few articles on the web which claimed that UTC time
formatting
would be supported in log4j 1.3, and could be used in a form like
%d{yyyy.MM.dd HH:mm:ss,SSS}{GMT}
or
%d{yyyy.MM.dd HH:mm:ss,SSS}{UTC}
I'm using log4j 1.3-alpha-8, and neither seems to work, nor can I find
any indication in the javadoc that this feature is supported.
This is an exceptionally useful feature to have when you have to
compare
log files from computers in different time zones.
The feature was implemented as bug 32064 (http://issues.apache.org/
bugzilla/show_bug.cgi?id=32064). The most critical code to look at
to diagnose a failure would start at line 91 in
org.apache.log4j.pattern.DatePatternConverter. I have not heard a
report of a failure and there are unit tests that should fail if the
feature is not functioning (particularly
o.a.l.pattern.PatternParserTest.testMultiOption. Is there anything
unusual about your choice of JVM, platform, et al? The documentation
for java.util.TimeZone should be checked to see if your options are
valid time zones on the JVM (i.e. they work with
TimeZone.getTimeZone). You might try GMT+0 since that is explicit in
the documentation (in JDK 1.4), but just GMT isn't.
As an aside, is there any chance a production version of 1.3 will be
available in 2007?
Actually, I don't ever foresee a production version of 1.3 as its
version number suggests drop in compatibility with log4j 1.2 and it
would be impractical to make it strictly compatible with log4j 1.2 as
compatibility wasn't guarded during the log4j 1.3 development
process. My personal goal has been to leapfrog 1.3 with an log4j 2.0
that would be designed for JDK 1.5 and later. Some log4j 1.3 have
been backported to log4j 1.2. I haven't looked at trying to
implement time zones on log4j 1.2. If you'd like to take a shot,
please feel free.
Cheers, Eric
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]