in the EAR file of my JEE application I have a log4j.xml to define the logging for that application.
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/">
<appender name="fileAppender" class="org.apache.log4j.DailyRollingFileAppender">
<param name="file" value="${jboss.server.log.dir}/licenseservice.log" />
<param name="append" value="true" />
<param name="datePattern" value="'.'yyyy-MM-dd" />
<layout class="org.apache.log4j.PatternLayout">
<param name="ConversionPattern" value="%d{yyyy-MM-dd HH:mm:ss} [%-5p] [%c:%L] - %m%n" />
</layout>
</appender>
<root>
<priority value="trace" />
<appender-ref ref="fileAppender" />
</root>
</log4j:configuration>
There are a few more entries in that file, but that them ignore for a moment. What I want to do is to change the time-zone of logged time to UTC. Somewhere I read you can do that by changing the pattern like this (if you want to have the time-zone of Germany):
%d{yyyy-MM-dd HH:mm:ss}{Europe/Berlin} [%-5p] [%c:%L] - %m%n
So my thought was that the following line should give me the UTC time:
%d{yyyy-MM-dd HH:mm:ss}{UTC} [%-5p] [%c:%L] - %m%n
But in the end both values didn't work.
Any ideas on that?