logging-log4j-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Curt Arnold <carn...@apache.org>
Subject Re: Possible to get unambiguous timestamp with v1.2.15 ?
Date Fri, 05 Feb 2010 02:34:33 GMT
Check out the EnhancedPatternLayout in the log4j extras companion, http://logging.apache.org/log4j/companions/extras/.
 It is an enhanced version of PatternLayout that is usage-compatible.  Basically, add log4j-extras.jar
to your path, change the Layout class to EnhancedPatternLayout and use a pattern like %d{HH:mm:ss}{GMT}
or whatever any other recognized timezone in the second set of braces.

Performance of SimpleDateFormat is a significant issue.  PatternLayout has an independent
implementation, EnhancedPatternLayout wraps a cache around SimpleDateFormat to avoid calling
it repeatedly for timestamps within an interval.

http://logging.apache.org/log4j/companions/extras/apidocs/org/apache/log4j/EnhancedPatternLayout.html


---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-user-help@logging.apache.org


Mime
View raw message