title: Log4J RollingFileAppender Unable to Roll File
body: <p>I am writing a small xml transformation layer in Java.  I receive xml via web service, modify it, and then send the modified xml to another system.  I then wait for a response and return the response to the original caller.</p>
  
  <pre><code>System A -&gt; Me -&gt; System B -&gt; Me -&gt; System A
  </code></pre>
  
  <p>I want to log the request I receive, the request I send, the response I receive, and the request I send.  Basically I want to log the xml where each arrow is in my diagram.</p>
  
  <p>My problem is with the RollingFileAppender.  I try to roll at 10MB, sometimes it does and sometimes it doesn't roll.  If it rolls a couple times, and then stops, it will continue to rename the rolled files from 3 to 4 and 4 to 5 and so on.</p>
  
  <p>My best guess is that when the 10MB mark is crossed, there are multiple threads writing to the log file so the file cannot me renamed.  I am hoping that Log4J has an easy solution for this, but if necessary, I am open to switching to a new logging framework.  Thank you in advance for any help.</p>
  
  <p><strong>EDIT</strong>
  Here is my properties file.</p>
  
  <pre><code>log4j.rootLogger=DEBUG, fileOut
  
  log4j.appender.fileOut=org.apache.log4j.RollingFileAppender
  log4j.appender.fileOut.File=/logs/log.log
  log4j.appender.fileOut.layout=org.apache.log4j.PatternLayout
  log4j.appender.fileOut.layout.ConversionPattern=%d %-5p %c - %m%n
  log4j.appender.fileOut.MaxFileSize=10MB
  log4j.appender.fileOut.MaxBackupIndex=10
  log4j.appender.fileOut.append=true
  </code></pre>
  
  <p><strong>EDIT 2</strong>  This is essentially a bump, as this post has a low number of views.  I feel like this cannot be a unique problem.  Any help is much appreciated.  Thanks!</p>