title: log4j rollingfileappender rotating catalina.out file but keeps writing in catalina.out.1 file
body: <p>I wanted to configure log4j rollingFileAppender in alfresco 4.0.1 as I wanted to keep rotating catalina.out file whenever it's size reaches 10MB. So I configured log4j with tomcat using below link.</p>
  
  <p><a href="http://tomcat.apache.org/tomcat-6.0-doc/logging.html#Using_Log4j" rel="nofollow">http://tomcat.apache.org/tomcat-6.0-doc/logging.html#Using_Log4j</a></p>
  
  <p>To configure rollingFileAppender I have written below lines in tomcat/lib/log4j.properties file.</p>
  
  <blockquote>
    <p>log4j.rootLogger=INFO, File</p>
    
    Console appender definition
    
    <p>log4j.appender.File=org.apache.log4j.RollingFileAppender
    log4j.appender.File.File=${catalina.base}/logs/catalina.out
    log4j.appender.File.MaxFileSize=10MB log4j.appender.File.Append=true
    log4j.appender.File.MaxBackupIndex=10
    log4j.appender.File.layout=org.apache.log4j.PatternLayout</p>
    
    <p>log4j.appender.File.layout.ConversionPattern=%d{ISO8601} [%x] [%p]
    [%c{3}] [%t] [%r] %m%n</p>
    
    <p>log4j.logger.org.apache.catalina.core.ContainerBase.[Catalina].[localhost]=INFO
    log4j.logger.org.apache.catalina.core=INFO
    log4j.logger.org.apache.catalina.session=INFO</p>
  </blockquote>
  
  <p>When I start alfresco and monitors logs, I can see that when catalina.out file reaches 10MB log4j renames it to catalina.out.1 file and creates new catalina.out file. But the issue is, tocmat keeps logging in catalina.out.1 file. It should be writing to catalina.out file always, right?</p>
  
  <p>How do I solve it??</p>