title: Yet another: log4net log file isn't created
body: <p>There are a lot of questions/answers regarding configuring log4net and I have been looking at them for a while.  Time to ask my own question.
  My problem is that my "Web api" web service does not create log files.  I
  want to create log files at: C:\Logs.  I have double checked that I have permission to write to this folder.  In addition, we use
  log4net for our functional tests and when I run the tests, the file FunctionalTests.log is created.  Therefore, I think we can
  rule out permissions.</p>
  
  <p>What am I doing wrong here?</p>
  
  <p>I have this line in my AssemblyInfo.cs file:</p>
  
  <pre><code>[assembly: log4net.Config.XmlConfigurator(ConfigFile = "Log4Net.config", Watch = true)]
  </code></pre>
  
  <p>I call XmlConfigurator.Configure() when my application starts.  In my debugger I can see that Application_Start is hit
  and the Configure() method invoked:</p>
  
  <pre><code>public class WebApiApplication : HttpApplication
  {
      protected void Application_Start()
      {
          XmlConfigurator.Configure();
          HibernateConfig.InitHibernate();
      }
  </code></pre>
  
  <p>Here is my Log4Net.config file, located at the root level of my project:</p>
  
  <pre><code>&lt;log4net debug="true"&gt;
    &lt;!-- Level 1 --&gt;
    &lt;appender name="LogFileAppender" type="log4net.Appender.RollingFileAppender"&gt;
      &lt;param name="File" value="C:\Logs\WebAPI.log"/&gt;
      &lt;lockingModel type="log4net.Appender.FileAppender+MinimalLock" /&gt;
      &lt;appendToFile value="true" /&gt;
      &lt;rollingStyle value="Size" /&gt;
      &lt;maxSizeRollBackups value="2" /&gt;
      &lt;maximumFileSize value="1000MB" /&gt;
      &lt;staticLogFileName value="true" /&gt;
      &lt;layout type="log4net.Layout.PatternLayout"&gt;
       &lt;param name="ConversionPattern" value="%d %property{X-CLIENT-REQUEST-ID} %property{X-REQUEST-ID} [%t] %-5p %c %m%n"/&gt;
      &lt;/layout&gt;
    &lt;/appender&gt;
  
    &lt;appender name="RequestLogAppender" type="log4net.Appender.RollingFileAppender"&gt;
      &lt;param name="File" value="C:\Logs\WebAPIRequests.log"/&gt;
      &lt;lockingModel type="log4net.Appender.FileAppender+MinimalLock" /&gt;
      &lt;appendToFile value="true" /&gt;
      &lt;rollingStyle value="Size" /&gt;
      &lt;maxSizeRollBackups value="2" /&gt;
      &lt;maximumFileSize value="1000MB" /&gt;
      &lt;staticLogFileName value="true" /&gt;
      &lt;layout type="log4net.Layout.PatternLayout"&gt;
        &lt;param name="ConversionPattern" value="%d %property{X-CLIENT-REQUEST-ID} %property{X-REQUEST-ID} [%t] %-5p %c %m%n"/&gt;
      &lt;/layout&gt;
    &lt;/appender&gt;
  
    &lt;root&gt;
      &lt;level value="ALL" /&gt;
      &lt;appender-ref ref="LogFileAppender" /&gt;
    &lt;/root&gt;
    &lt;logger additivity="false" name="Request"&gt;
      &lt;level value="INFO" /&gt;
      &lt;appender-ref ref="RequestLogAppender" /&gt;
    &lt;/logger&gt;
  &lt;/log4net&gt;
  </code></pre>