jasonyu created LOG4J2-2941:
-------------------------------
Summary: zero-padding configuration problem
Key: LOG4J2-2941
URL: https://issues.apache.org/jira/browse/LOG4J2-2941
Project: Log4j 2
Issue Type: Improvement
Components: Configuration
Affects Versions: 2.13.3
Environment: My configuration demo is as follow:
{code:java}
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{code}
Reporter: jasonyu
Fix For: 2.14.0
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.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)