Пример конфигурационного файла log4j - rest-log4j.xml
<?xml version="1.0" encoding="UTF-8"?>
<Configuration status="DEBUG">
<Properties>
<Property name="base">${sys:catalina.base}/logs</Property>
<Property name="app">rest</Property>
</Properties>
<Appenders>
<RollingFile name="${app}" fileName="${base}/${app}.log"
filePattern="${base}/arcs/${symbol_dollar}{app}-%d{yyyy-MM-dd-HH}-%i.log.gz">
<PatternLayout pattern="%d %p %c{1.} [%t] %m%n"/>
<Policies>
<!-- TimeBasedTriggeringPolicy / -->
<SizeBasedTriggeringPolicy size="10MB" />
</Policies>
<DefaultRolloverStrategy max="100">
<Delete basePath="${base}/arcs" maxDepth="2">
<IfFileName glob="${app}-*.log.gz" />
<IfLastModified age="20d" />
</Delete>
</DefaultRolloverStrategy>
</RollingFile>
</Appenders>
<Loggers>
<root level="info" additivity="false">
<AppenderRef ref="${app}" />
</root>
</Loggers>
</Configuration>