I want the log should contain date entries of specific timezone. Is there any way of forcing timezone in log4j.properties
?
Now I am using JDK 1.5, As you al
The best way is to use the Apache Extras™ for Apache log4j™ And replace The normal PatternLayout by org.apache.log4j.EnhancedPatternLayout doing the following if using a property file:
//log4j.appender.xxx.layout = org.apache.log4j.PatternLayout
//Replaced by
log4j.appender.xxx.layout = org.apache.log4j.EnhancedPatternLayout
Then you can use %d{ISO8601}{GMT} instead of %d in the ConversionPattern to display your date in the GMT format. Any timezone can be specified instead of GMT