I am getting the following error when I remove the date in the file pattern on 
my RollingRandomAccessFile appender.

Caused by: java.lang.IllegalStateException: Pattern does not contain a date


Here is the appender part of my configuration file:

                    <RollingRandomAccessFile name="RollingRandomAccessFile" 
fileName="${sys:logDir}/${sys:logFilename}.log"
                                             
filePattern="${sys:logDir}/${sys:logFilename}-%i.log">
                        <PatternLayout>
                            <header>${sys:app_title} ${sys:app_version}  
${java:version} - ${java:vm} - ${java:os} - ${java:hw}${sys:newline}</header>
                            <pattern>%d{yyyy-MMM-dd HH:mm:ss.SSS} %-6p [%t] 
%C{2} %M %m%n</pattern>
                        </PatternLayout>
                        <Policies>
                            <!--OnStartupTriggeringPolicy/-->
                            <TimeBasedTriggeringPolicy/>
                            <SizeBasedTriggeringPolicy size="10 MB"/>
                        </Policies>
                        <DefaultRolloverStrategy min="1" max="3" 
fileindex="max" />
                    </RollingRandomAccessFile>

If I change the filePattern to the following then it works fine:

                                             
filePattern="${sys:logDir}/${sys:logFilename} -%d{yyyy-MM-dd}-%i.log">

According to the documentation I should be able to use a date and/or an index 
counter.  Has anyone else come across this before?  I am using the latest 
release.

Thx Blaine

Reply via email to