My customer reported that the log files of my application were consuming too much disc space. After some analysis i found out that the compacting to zip files was not applied. I need to find out why, but i am missing the needed error diagnosis messages.
I use a RollingFileAppender with following configuration.
Apart from the zip compression everything else works.
I made some effort to reproduce the issue on my machine with debugging enabled.
I found out that org.apache.logging.log4j.core.appender.rolling.action.ZipCompressAction is responsible for doing the actual zip compressing. At this point something could go wrong and an exception would be raised. But as far as i comprehend the code this exception is not handled appropriate.
The org.apache.logging.log4j.core.appender.rolling.RollingFileManager executed this action during the rollover in some asyncExecutor. The actions are wrapped in the inner class RollingFileManager$AsyncAction.
The top level method org.apache.logging.log4j.core.appender.rolling.action.AbstractAction.run() catches IOExceptions as expected.
RollingFileManager$AsyncAction does not override the method reportException(Exception) and in AbstractAction the implementation is empty.
This leads me to assume that any IOException during zip compacting in the context of RollingFileAppender is silently ignored.
I would expect that such Exception is reported and logged on WARN or ERROR level.