log4j2 - DefaultRolloverStrategy for daily RollingFile appender, max not respected
问题 I am trying to write an appender with a daily rolling policy with 10 maximum total files no matter the day . Every 10 MB it creates a new log file and stores it with today's date and an index. This is what I have so far: <RollingFile name="MyRollingFile" fileName="./log/logs.log" filePattern="./log/logs-%d{yyyy-MM-dd}-%i.log"> <PatternLayout> <pattern>%n%d{yy-MM-dd HH:mm:ss.SSS} [%p] %m</pattern> </PatternLayout> <Policies> <SizeBasedTriggeringPolicy size="10MB" /> </Policies>