title: log4net only works when XmlConfigurator.Configure() is called
body: <p>I understand that <a href="https://stackoverflow.com/questions/445976/log4net-config-in-external-file-does-not-work/1479343#1479343">this</a> <a href="https://stackoverflow.com/questions/3519100/log4net-not-working">question</a> <a href="https://stackoverflow.com/questions/3618380/log4net-does-not-write-the-log-file">has</a> <a href="https://stackoverflow.com/questions/9481960/log4net-in-windows-forms-app-does-not-write-log-file">been</a> <a href="https://stackoverflow.com/questions/2850380/log4net-logging-problem-very-simple-file-appender-logging-not-working">asked</a> <a href="https://stackoverflow.com/questions/2850380/log4net-logging-problem-very-simple-file-appender-logging-not-working">several</a> <a href="http://apache-logging.6191.n7.nabble.com/Log4net-NOT-working-on-net-4-5-td36572.html" rel="noreferrer">times</a>, but unfortunately, I haven't been able to get my logging configuration working.  I have to be making some very small mistake somewhere.</p>
  
  <p>I have a .NET 4.5 MVC 4/EF 5 web application and I'm trying to get logging to work.  The solution has two projects, one for the DAO's and model objects, and one for the web site.
  The App.Config file looks like this:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;configuration&gt;
    &lt;configSections&gt;
      &lt;!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 --&gt;
      &lt;section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=5.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" /&gt;
      &lt;section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler, log4net" requirePermission="false" /&gt;
    &lt;/configSections&gt;
    &lt;connectionStrings&gt;
      &lt;add name="RebuildingTogetherEntities" connectionString="stuff..."/&gt;
    &lt;/connectionStrings&gt;
    &lt;entityFramework&gt;
      &lt;defaultConnectionFactory type="System.Data.Entity.Infrastructure.SqlConnectionFactory, EntityFramework" /&gt;
    &lt;/entityFramework&gt;
    &lt;log4net configSource="Log.config" /&gt;
  &lt;/configuration&gt;
  </code></pre>
  
  <p>The same log4net section has also been copied into the Web.Config file.  </p>
  
  <p>I added the following to both AssemblyInfo.cs files:</p>
  
  <pre><code>[assembly: log4net.Config.XmlConfigurator(ConfigFile = "Log.config", Watch = true)]
  </code></pre>
  
  <p>"Copy To Output Directory" is set to true for both Log.Config files.</p>
  
  <p>The only way that I can seem to get logging to append to the output file is to call XmlConfigurator.Configure() before the first logging statement runs.  I guess I can write a facade to do that when I first obtain the logger, but that just feels wrong.</p>
  
  <p>How can I initialize the logger without calling the XmlConfigurator manually?</p>