Details
-
Bug
-
Status: Open
-
Critical
-
Resolution: Unresolved
-
2.17.0
-
None
-
None
Description
on my tomcat server only daily log rotate is not working, logs are recorded on the same catalina.log file. SizeBasedTriggeringPolicy and OnStartupTriggeringPolicy is working as expected.
below are the log4j2-tomcat.xml file trace
<?xml version="1.0" encoding="utf-8"?>
<Configuration status="info">
<Properties>
<Property name="logdir">${sys:catalina.base}/logs</Property>
<Property name="layout">TOMCAT %d [%t] %5p %c %m%n</Property>
</Properties>
<Appenders>
<RollingFile name="CATALINA" fileName="${logdir}/catalina.log" filePattern="${logdir}/catalina.%d{yyyy-MM-dd}-%i.log">
<PatternLayout pattern="${layout}"/>
<Policies>
<TimeBasedTriggeringPolicy interval="1" modulate="true"/>
<SizeBasedTriggeringPolicy size="5MB"/>
<OnStartupTriggeringPolicy />
</Policies>
<DefaultRolloverStrategy max="30"/>
</RollingFile>
</Appenders>
<Loggers>
<Root level="INFO">
<AppenderRef ref="CATALINA"/>
</Root>
<Logger name="org.apache.catalina.core.ContainerBase.[Catalina].[localhost]" level="info" additivity="false">
<AppenderRef ref="CATALINA"/>
</Logger>
</Loggers>
</Configuration>