-
-
Save varvaruc/fbb2559282e04f40d3a747ca1d69941b to your computer and use it in GitHub Desktop.
Log4j2.xml for Tomcat
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="utf-8"?> | |
<Configuration status="info"> | |
<Properties> | |
<Property name="logdir">${sys:catalina.base}/logs</Property> | |
<Property name="layout">%d [%t] %-5p %c- %m%n</Property> | |
</Properties> | |
<Appenders> | |
<Console name="CONSOLE" target="SYSTEM_OUT"> | |
<PatternLayout pattern="${layout}"/> | |
</Console> | |
<RollingFile name="CATALINA" | |
fileName="${logdir}/catalina.log" | |
filePattern="${logdir}/catalina.%d{yyyy-MM-dd}.log.gz"> | |
<PatternLayout pattern="${layout}"/> | |
<CronTriggeringPolicy schedule="0 0 0 * * ?"/> | |
<DefaultRolloverStrategy> | |
<Delete basePath="${logdir}" maxDepth="1"> | |
<IfFileName glob="catalina.*.log.gz" /> | |
<IfAccumulatedFileCount exceeds="10" /> | |
</Delete> | |
</DefaultRolloverStrategy> | |
</RollingFile> | |
<RollingFile name="LOCALHOST" | |
fileName="${logdir}/localhost.log" | |
filePattern="${logdir}/localhost.%d{yyyy-MM-dd}.log.gz"> | |
<PatternLayout pattern="${layout}"/> | |
<CronTriggeringPolicy schedule="0 0 0 * * ?"/> | |
<DefaultRolloverStrategy> | |
<Delete basePath="${logdir}" maxDepth="1"> | |
<IfFileName glob="localhost.*.log.gz" /> | |
<IfAccumulatedFileCount exceeds="10" /> | |
</Delete> | |
</DefaultRolloverStrategy> | |
</RollingFile> | |
<RollingFile name="MANAGER" | |
fileName="${logdir}/manager.log" | |
filePattern="${logdir}/manager.%d{yyyy-MM-dd}.log.gz"> | |
<PatternLayout pattern="${layout}"/> | |
<CronTriggeringPolicy schedule="0 0 0 * * ?"/> | |
<DefaultRolloverStrategy> | |
<Delete basePath="${logdir}" maxDepth="1"> | |
<IfFileName glob="manager.*.log.gz" /> | |
<IfAccumulatedFileCount exceeds="10" /> | |
</Delete> | |
</DefaultRolloverStrategy> | |
</RollingFile> | |
<RollingFile name="HOST-MANAGER" | |
fileName="${logdir}/host-manager.log" | |
filePattern="${logdir}/host-manager.%d{yyyy-MM-dd}.log.gz"> | |
<PatternLayout pattern="${layout}"/> | |
<CronTriggeringPolicy schedule="0 0 0 * * ?"/> | |
<DefaultRolloverStrategy> | |
<Delete basePath="${logdir}" maxDepth="1"> | |
<IfFileName glob="host-manager.*.log.gz" /> | |
<IfAccumulatedFileCount exceeds="10" /> | |
</Delete> | |
</DefaultRolloverStrategy> | |
</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="LOCALHOST"/> | |
</Logger> | |
<Logger name="org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/manager]" | |
level="info" | |
additivity="false"> | |
<AppenderRef ref="MANAGER"/> | |
</Logger> | |
<Logger name="org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/host-manager]" | |
level="info" | |
additivity="false"> | |
<AppenderRef ref="HOST-MANAGER"/> | |
</Logger> | |
</Loggers> | |
</Configuration> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment