title: Log4Net not logging in .NET WebApi project using UnityContainer
body: <p>I have a very basic C# .NET WebApi project using Unity.AspNet.WebApi and Unity.Mvc for dependency injection and Unity.log4net for logging.</p>
  
  <p>The injection into my controllers seems to be working correctly. The problem is that the logger never logs anything. The expected .log file is never created. When I inspect the logger object while debugging it has all the levels disabled (IsDebugEnable = false, IsErrorEnabled = false, etc.)</p>
  
  <p>It is running as if has ignored my log4net.config file. In the root of my project I have a log4net.config file that defines a console and a file appender.</p>
  
  <pre><code>&lt;log4net&gt;
    &lt;root&gt;
      &lt;level value="ALL" /&gt;
      &lt;appender-ref ref="console" /&gt;
      &lt;appender-ref ref="file" /&gt;
    &lt;/root&gt;
    &lt;appender name="console" type="log4net.Appender.ConsoleAppender"&gt;
      &lt;layout type="log4net.Layout.PatternLayout"&gt;
        &lt;conversionPattern value="%date %level %logger - %message%newline" /&gt;
      &lt;/layout&gt;
    &lt;/appender&gt;
    &lt;appender name="file" type="log4net.Appender.RollingFileAppender"&gt;
      &lt;file value="DemoWebApiUnityLog4Net.log" /&gt;
      &lt;appendToFile value="true" /&gt;
      &lt;rollingStyle value="Size" /&gt;
      &lt;maxSizeRollBackups value="5" /&gt;
      &lt;maximumFileSize value="10MB" /&gt;
      &lt;staticLogFileName value="true" /&gt;
      &lt;layout type="log4net.Layout.PatternLayout"&gt;
        &lt;conversionPattern value="%date [%thread] %level %logger - %message%newline" /&gt;
      &lt;/layout&gt;
    &lt;/appender&gt;
  &lt;/log4net&gt;
  </code></pre>
  
  <p>I have added this line to AssemblyInfo.cs</p>
  
  <pre><code>[assembly: log4net.Config.XmlConfigurator(ConfigFile = @"log4net.config", Watch = true)]
  </code></pre>
  
  <p>The log4net was registered in to the Unity container in UnityConfig.cs with this line:</p>
  
  <pre><code>container.AddNewExtension&lt;Log4NetExtension&gt;();
  </code></pre>
  
  <p>The full demo project can be found here: <a href="https://github.com/CarmonColvin/DemoWebApiUnityLog4Net" rel="nofollow noreferrer">https://github.com/CarmonColvin/DemoWebApiUnityLog4Net</a></p>
  
  <p>Nothing I have tried has resulted in a successful log. Any help is appreciated.</p>