JohnLussmyer opened a new issue, #1804:
URL: https://github.com/apache/logging-log4j2/issues/1804
## Description
If there are 2 RollingRandomAccessFile appenders that have .zip on their
FilePattern - neither one will have logs zipped.
If only one of them uses .zip, it works.
## Configuration
**Version:** 2.19.0
**Operating system:** Win 11
**JDK:** Adoptium JDK 17.0.5+8
## Logs
## Reproduction
log4j.xml
<?xml version="1.0" encoding="UTF-8"?>
<Configuration status="WARN" >
<Appenders>
<RollingRandomAccessFile name="Log"
fileName="${sys:metrixLogFolder}/${sys:metrixLogName}.log"
filePattern="${sys:metrixLogFolder}/${sys:metrixLogName}.%i.log.zip"
>
<PatternLayout pattern="%d{yyyy-MM-dd HH:mm:ss.SSS} [%20.20t]
%-5level %30.30logger - %msg%n"
header="Application: ${sys:metrixBuild}%n" />
<!-- <ThresholdFilter level="info" /> -->
<Policies>
<OnStartupTriggeringPolicy />
<SizeBasedTriggeringPolicy size="100 MB" />
</Policies>
</RollingRandomAccessFile>
<RollingRandomAccessFile name="ErrorLog"
fileName="${sys:metrixLogFolder}/${sys:metrixAppName}.errors.log"
filePattern="${sys:metrixLogFolder}/${sys:metrixAppName}.errors-%i.log.zip"
>
<PatternLayout pattern="%d{yyyy-MM-dd HH:mm:ss.SSS} [%20.20t]
%-5level %30.30logger - %msg%n"
header="Application: ${sys:metrixBuild}%n" />
<ThresholdFilter level="error" />
<Policies>
<SizeBasedTriggeringPolicy size="100 MB" />
</Policies>
</RollingRandomAccessFile>
<Console name="Console" target="SYSTEM_OUT">
<PatternLayout>
<Pattern>%d{HH:mm:ss.SSS} [%20.20t] %-5level %30.30logger -
%msg%n</Pattern>
</PatternLayout>
</Console>
</Appenders>
<Loggers>
<Root level="info">
<AppenderRef ref="ErrorLog" />
<AppenderRef ref="Log" />
<AppenderRef ref="Console" />
</Root>
<Logger name="org.apache.activemq" level="error" />
</Loggers>
</Configuration>
If you remove the ".zip" from either RollingRandomAccessFileAppnder
filePattern - the zip works on the other. If both have .zip, none of the logs
ever get zipped.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]