In our application, Logstash plain log file - logstas-plain.log is getting converted to a zip file logstash-plain-<date>.log.gz each day. The zip files are getting piled up and causing a memory issue.
Any help on configuring log4j2.properties to setup the logs rotation so that older zip files can get deleted either with SizeBasedTriggeringPolicy or TimeBasedTriggeringPolicy would be appreciable.
The default max configuration was by default set to 30 in log4j2.properties but I can see around 50 logs in our logs path as the time based roll over approach is preceding over size based approach ( log file size not reaching 100MB before 1 day finishes).
The appender.rolling.strategy.max applies to both the TimeBasedTriggeringPolicy and to the SizeBasedTriggeringPolicy since they are both using the DefaultRolloverStrategy.
If there were 50 logs in your log path were those all of the same log type? The appender.rolling.strategy.max is the maximum for each log and not the maximum for the entire log folder.
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.