CORS issue when adding log4net config
<p><strong>Context:</strong></p>

<p>I have a simple Web API project with a controller and an action.
In the header of each request, I add an authorization token.
Everything work as expected. I can request a token based on some credentials, and use it to make HTTP requests successfully.</p>

<p><strong>Problem:</strong>
When I add the following in the web.config:</p>

<pre><code>&lt;log4net&gt;
&lt;appender name="FileAppender" type="log4net.Appender.FileAppender"&gt;
  &lt;lockingModel type="log4net.Appender.FileAppender+MinimalLock" /&gt;
  &lt;file value="logfile.txt" /&gt;
  &lt;appendToFile value="true" /&gt;
  &lt;layout type="log4net.Layout.PatternLayout"&gt;
    &lt;conversionPattern value="%date: %-5level – %message%newline" /&gt;
  &lt;/layout&gt;
&lt;/appender&gt;
&lt;root&gt;
  &lt;level value="DEBUG" /&gt;
  &lt;appender-ref ref="FileAppender" /&gt;
&lt;/root&gt;
&lt;/log4net&gt;
</code></pre>

<p>I get the following error:</p>

<pre><code>XMLHttpRequest cannot load http://localhost:4042/token. Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost:8080' is therefore not allowed access. The response had HTTP status code 500.
</code></pre>

<p>If I remove the configuration for log4net everything works as expected.</p>

<p><strong>Note:</strong> I do not have any setting in web.config that adds headers in a request. </p>

<p><strong>Startup.cs</strong> is the only point in the project were I specify:</p>

<blockquote>
  <p>app.UseCors(Microsoft.Owin.Cors.CorsOptions.AllowAll);</p>
</blockquote>

<p><strong>Question:</strong> How does the log4net configuration relate to preflight requests?
(based on my limited knowledge about the ASP.NET framework I would say it is non-sense). Is there a subtlety that am I missing?</p>