Hi,
I would like to modify log4j2.xml so that it includes dates in the files. I tried jar xf and jar cf but the resulting jar could not find the manifest.
The patch is:
I don't mind running the unzipped jar file but I'm not sure how to do this.
Thanks
I would like to modify log4j2.xml so that it includes dates in the files. I tried jar xf and jar cf but the resulting jar could not find the manifest.
The patch is:
Code:
--- log4j2.xml.orig 2015-11-10 16:42:16.000000000 +0100
+++ log4j2.xml 2016-07-21 06:18:56.000000000 +0200
@@ -11,7 +11,7 @@
<PatternLayout pattern="[%d{HH:mm:ss}] [%t/%level] [%logger]: %msg%n" />
</Queue>
<RollingRandomAccessFile name="File" fileName="logs/latest.log" filePattern="logs/%d{yyyy-MM-dd}-%i.log.gz">
- <PatternLayout pattern="[%d{HH:mm:ss}] [%t/%level]: %msg%n" />
+ <PatternLayout pattern="[%d{yyyyMMdd-HH:mm:ss}] [%t/%level]: %msg%n" />
<Policies>
<TimeBasedTriggeringPolicy />
<OnStartupTriggeringPolicy />
@@ -21,7 +21,7 @@
<Routes pattern="$${ctx:side}">
<Route>
<RollingRandomAccessFile name="FmlFile" fileName="logs/fml-${ctx:side}-latest.log" filePattern="logs/fml-${ctx:side}-%i.log">
- <PatternLayout pattern="[%d{HH:mm:ss}] [%t/%level] [%logger/%X{mod}]: %msg%n" />
+ <PatternLayout pattern="[%d{yyyyMMdd-HH:mm:ss}] [%t/%level] [%logger/%X{mod}]: %msg%n" />
<DefaultRolloverStrategy max="3" fileIndex="max" />
<Policies>
<OnStartupTriggeringPolicy />
@@ -30,7 +30,7 @@
</Route>
<Route key="$${ctx:side}">
<RandomAccessFile name="FmlFile" fileName="logs/fml-junk-earlystartup.log" >
- <PatternLayout pattern="[%d{HH:mm:ss}] [%t/%level] [%logger]: %msg%n" />
+ <PatternLayout pattern="[%d{yyyyMMdd-HH:mm:ss}] [%t/%level] [%logger]: %msg%n" />
</RandomAccessFile>
</Route>
</Routes>
I don't mind running the unzipped jar file but I'm not sure how to do this.
Thanks