title: How to use log4net in Asp.net core 2.0
body: <p>I configure <code>log4net</code> in my asp.net core 2.0 application as mentioned in this article <a href="https://stackify.com/making-log4net-net-core-work/" rel="noreferrer">LINK</a> </p>
  
  <p>program.cs</p>
  
  <pre><code>public static void Main(string[] args)
  {
      var logRepository = LogManager.GetRepository(Assembly.GetEntryAssembly());
      XmlConfigurator.Configure(logRepository, new FileInfo("log4net.config"));
  
      BuildWebHost(args).Run();
  }
  </code></pre>
  
  <p>HomeController</p>
  
  <pre><code>public class HomeController : Controller
  {
      private static readonly log4net.ILog log = log4net.LogManager.GetLogger(typeof(HomeController));
  
      public IActionResult Error()
      {
          log.Info("Hello logging world!");
          return View(new ErrorViewModel { RequestId = Activity.Current?.Id ?? HttpContext.TraceIdentifier });
      }
  }
  </code></pre>
  
  <p>log4net.config </p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;configuration&gt;
    &lt;log4net&gt;
      &lt;root&gt;
        &lt;level value="ALL" /&gt;
        &lt;appender-ref ref="RollingFile" /&gt;
      &lt;/root&gt;
      &lt;appender name="RollingFile" type="log4net.Appender.FileAppender"&gt;
        &lt;file value="‪C:\Temp\app.log" /&gt; 
        &lt;layout type="log4net.Layout.PatternLayout"&gt;
          &lt;conversionPattern value="%-5p %d{hh:mm:ss} %message%newline" /&gt;
        &lt;/layout&gt;
      &lt;/appender&gt;
    &lt;/log4net&gt;
  &lt;/configuration&gt;
  </code></pre>
  
  <p>Unlucky!, I didn't see any file generated in ‪<code>C:\Temp\app.log</code> directory. What would be the mistake? how to configure <code>log4net</code> for asp.net core 2.0? </p>