title: .NET Web Deployment Tool with log4Net: Not overwriting logs
body: <p>I'm using the Web Deployment Tool to build and release an MVC site from VS 2010 to a server running IIS. I also have log4net logging to a subdirectory off of the root of the web application I'm deploying to. I already figured out how to keep write permissions intact when deploying with this tool on that directory, but now I'm running into the problem that I'd rather not lose the logs when deploying, and also, the deploy is failing because the log file that log4net is using is "used by another process" (presumably w3wp) and won't let the deploy continue.</p>
  
  <p>So, I'd like to preserve the log files and not delete or overwrite them, for auditing purposes. Is there a way to do that within the confines of the Web Deployment Tool?</p>
  
  <p><strong>EDIT</strong>: Here's the applicable bits of the log4net configuration, in Web.Config.</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;configuration&gt;
    &lt;configSections&gt;
      &lt;section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler,Log4net" /&gt;
    &lt;/configSections&gt;
    &lt;log4net&gt;
      &lt;appender name="RollingLog" type="log4net.Appender.RollingFileAppender"&gt;
        &lt;param name="File" value="Logs\Log.txt" /&gt;
        &lt;param name="AppendToFile" value="true" /&gt;
        &lt;rollingStyle value="Composite" /&gt;
        &lt;maxSizeRollBackups value="20" /&gt;
        &lt;maximumFileSize value="10MB" /&gt;
        &lt;datePattern value="yyyyMMdd" /&gt;
        &lt;staticLogFileName value="true" /&gt;
        &lt;layout type="log4net.Layout.PatternLayout"&gt;
          &lt;conversionPattern value="{%level}%date{MM/dd HH:mm:ss} - %message%newline" /&gt;
        &lt;/layout&gt;
      &lt;/appender&gt;
      &lt;root&gt;
        &lt;level value="DEBUG" /&gt;
        &lt;appender-ref ref="RollingLog" /&gt;
      &lt;/root&gt;
    &lt;/log4net&gt;
  &lt;/configuration&gt;
  </code></pre>