log4j2 RollingFile Appender requires date pattern
log4j2
Solution
Thanks Joe. I finally figured it out.
I had an empty TimeBasedTriggeringPolicy tag within my Policies list which was forcing the date check in the filePattern. Once I removed it, it started working fine.
Problem
I have defined a RollingFile Appender in log4j2 ``` <RollingFile name="Locserver" append="true" fileName="locserver.log" filePattern="locserver-%i.log"> <PatternLayout> <pattern>%d{ISO8601} [%t] %p %c %L - %m%n</pattern> </PatternLayout> <Policies> <SizeBasedTriggeringPolicy size="50 MB"></SizeBasedTriggeringPolicy> <DefaultRolloverStrategy>10</DefaultRolloverStrategy> </Policies> </RollingFile> ``` However when I try to run this I get an error IllegalStateException : Pattern does not contain a date at org.apache.logging.log4j.core.appender.rolling.PatternProcessor.getNExtTime(PatternProcessor.java:91) This goes away as soon as I put a date pattern in filePattern for example, `locserver-%d{MM-dd-yyyy}-%i.log`. But I dont want the date in the log names. Is a bug or something wrong with my config?