We are using a RollingFileAppender defined as follows:

 

   <appender name="FILE" class="org.apache.log4j.RollingFileAppender">

       <param name="maxFileSize" value="200MB" />

       <param name="maxBackupIndex" value="12" />

       <param name="File" value="${LOGNAME}" />

       <param name="Append" value="false"/>

       <layout class="org.apache.log4j.PatternLayout">

           <param name="ConversionPattern"

               value="%d{MM-dd HH:mm:ss.SSS} %5p %c{1} - %m%n" />

       </layout>

   </appender>

 

This works the way we want with one exception: When our app that uses
this appender starts up it overwrites the existing log file. This is of
course because we have Append set to false. What we'd like to have
happen is that if there is an existing log file have a rollover occur
immediately so that no log data is lost. Can that be setup or is our
only option is to set Append to true?

 

Reply via email to