The TimeBasedTriggeringPolicy needs the date to determine how frequently it should roll over. If you remove that then you should be able to remove the date pattern.
Ralph On Aug 12, 2013, at 7:33 AM, Aliaksandr Belavusau wrote: > Hi guys, > > > > Is it possible to declare filePattern attribute without date pattern? > > > > <FastRollingFile name="LOGFILE" fileName="logs/app.log" > filePattern="logs/app.log.%d{yyyy-MM-dd}.%i"> > > <ThresholdFilter level="DEBUG" onMatch="ACCEPT" > onMismatch="DENY"/> > > <PatternLayout> > > <pattern>%d %5p [%t] %c ${ctx:Id} ${ctx:Code} - > %m%n</pattern> > > </PatternLayout> > > <Policies> > > <TimeBasedTriggeringPolicy /> > > <SizeBasedTriggeringPolicy size="10 MB"/> > > </Policies> > > <DefaultRolloverStrategy max="100"/> > > </FastRollingFile> > > > > I'd like to name files: app.log, app.log.0, app.log.1, : , app.log.n, but > with filePattern="logs/app.log.%i" IllegalStateException was thrown. > > > > Caused by: java.lang.IllegalStateException: Pattern does not contain a date > > at > org.apache.logging.log4j.core.appender.rolling.PatternProcessor.getNextTime( > PatternProcessor.java:88) > > at > org.apache.logging.log4j.core.appender.rolling.TimeBasedTriggeringPolicy.ini > tialize(TimeBasedTriggeringPolicy.java:49) > > at > org.apache.logging.log4j.core.appender.rolling.CompositeTriggeringPolicy.ini > tialize(CompositeTriggeringPolicy.java:43) > > at > org.apache.logging.log4j.core.appender.rolling.RollingFileManager.<init>(Rol > lingFileManager.java:57) > > at > org.apache.logging.log4j.core.appender.rolling.FastRollingFileManager.<init> > (FastRollingFileManager.java:49) > > at > org.apache.logging.log4j.core.appender.rolling.FastRollingFileManager$FastRo > llingFileManagerFactory.createManager(FastRollingFileManager.java:158) > > at > org.apache.logging.log4j.core.appender.rolling.FastRollingFileManager$FastRo > llingFileManagerFactory.createManager(FastRollingFileManager.java:127) > > at > org.apache.logging.log4j.core.appender.AbstractManager.getManager(AbstractMa > nager.java:71) > > at > org.apache.logging.log4j.core.appender.OutputStreamManager.getManager(Output > StreamManager.java:65) > > at > org.apache.logging.log4j.core.appender.rolling.FastRollingFileManager.getFas > tRollingFileManager(FastRollingFileManager.java:61) > > at > org.apache.logging.log4j.core.appender.FastRollingFileAppender.createAppende > r(FastRollingFileAppender.java:201) > > ... 50 more > --------------------------------------------------------------------- To unsubscribe, e-mail: log4j-user-unsubscr...@logging.apache.org For additional commands, e-mail: log4j-user-h...@logging.apache.org