How does Log4j2 DefaultRolloverStrategy’s max attribute really work?
The DefaultRolloverStrategy will use the date pattern specified in the filePattern if a TimeBasedTriggeringPolicy is specified. To use the max attribute, specify a %i pattern in the filePattern, and add <SizeBasedTriggeringPolicy size=”20 MB” /> to the rollover policies. (Or some other size of course.) The value for max in <DefaultRolloverStrategy max=”5″/> will then ensure that … Read more