I'm using Log4j2 ver 2.3
log4j2.xml looks like:
<?xml version="1.0" encoding="UTF-8"?>
<Configuration>
<Appenders>
<RollingFile name="RollingFile"
fileName="${sys:catalina.base}/logs/catalina.${date:yyyy-MM-dd}.log"
filePattern="${sys:catalina.base}/logs/catalina.%d{yyyy-MM-dd}.log">
<PatternLayout pattern="[TID=%X{TId}] %d{MMM dd, yyyy HH:mm:ss,SSS} %c %M:%L %p: %m%n"/>
<TimeBasedTriggeringPolicy modulate="true" />
</RollingFile>
</Appenders>
<Loggers>
<Root level="DEBUG" >
<AppenderRef ref="RollingFile" />
</Root>
</Loggers>
</Configuration>
All works fine until next day when log from a previous day is getting overwritten by some logs from current day.
Example: catalina.2018-03-21.log yesterday (March 21st) was fine but today got overwritten by some logs from 2018-03-22 when catalina.2018-03-22.log contains rest of logs from today (March 22nd)
Any thoughts?
RollingFile
as current date is appended to the log filename anyway? – Leathery