Details
-
Improvement
-
Status: Closed
-
Major
-
Resolution: Resolved
-
2.13.3
-
My configuration demo is as follow:
name = PropertiesConfig property.filePath = /users/jasonyu/Desktop/logs monitorInterval = 10 appenders = rolling appender.rolling.type = RollingFile appender.rolling.name = RollingLogFile appender.rolling.fileName=${filePath}/server.log appender.rolling.filePattern = ${filePath}/server-%04i.log.gz appender.rolling.layout.type = PatternLayout appender.rolling.layout.pattern=[%-5level] %d{yyyy-MM-dd HH:mm:ss.SSS} [%t] %c{1} - %msg%n appender.rolling.filter.threshold.type = ThresholdFilter appender.rolling.filter.threshold.level = info appender.rolling.policies.type = Policies appender.rolling.policies.size.type = SizeBasedTriggeringPolicy appender.rolling.policies.size.size = 3MB appender.rolling.strategy.type = DefaultRolloverStrategy appender.rolling.strategy.max = 500 appender.rolling.strategy.fileIndex = max rootLogger.level = INFO rootLogger.appenderRef.rolling.ref = RollingLogFile
My configuration demo is as follow: name = PropertiesConfig property.filePath = /users/jasonyu/Desktop/logs monitorInterval = 10 appenders = rolling appender.rolling.type = RollingFile appender.rolling.name = RollingLogFile appender.rolling.fileName=${filePath}/server.log appender.rolling.filePattern = ${filePath}/server-%04i.log.gz appender.rolling.layout.type = PatternLayout appender.rolling.layout.pattern=[%-5level] %d{yyyy-MM-dd HH:mm:ss.SSS} [%t] %c{1} - %msg%n appender.rolling.filter.threshold.type = ThresholdFilter appender.rolling.filter.threshold.level = info appender.rolling.policies.type = Policies appender.rolling.policies.size.type = SizeBasedTriggeringPolicy appender.rolling.policies.size.size = 3MB appender.rolling.strategy.type = DefaultRolloverStrategy appender.rolling.strategy.max = 500 appender.rolling.strategy.fileIndex = max rootLogger.level = INFO rootLogger.appenderRef.rolling.ref = RollingLogFile
Description
I used the configuration file which set the filePattern like "appender.rolling.filePattern = ${filePath}/server-%04i.log.gz" and "appender.rolling.strategy.max = 500".I wanted to use the zero-padding and keep 500 log files at the same time. But, the log files stopped increasing since the counter reach 100 seems like the configuration 500 not work.
In another situation that I used "%i" instead of "%04i", the maxIndex 500 worked normally, so maybe the problem is related to zero-padding.
Attachments
Issue Links
- is related to
-
LOG4J2-3432 RollingFileAppender fails after 100 backup cycles if filePattern contains "%04i" .
- Resolved