title: ASP.Net Core 2.0 Webapi set log4net
body: <p>I am new to asp.net core 2.0. I creating a webapi and want to configure log4net as my logging provider.</p>
  
  <p>I couldn't find some working example in net. Can anyone help me provide the right link or some sample code about how to properly setup log4net in asp.net core 2.0</p>
  
  <p>Things i have done so far is as below and i am not sure how to proceed further.</p>
  
  <p>installed log4net.Extensions.AspNetCore;</p>
  
  <h2>Startup.cs</h2>
  
  <pre><code>public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory)
  {
      if (env.IsDevelopment())
      {
          app.UseDeveloperExceptionPage();
      }
  
      loggerFactory.AddLog4Net();
  
      // Enable CORS 
      app.UseCors(builder =&gt; builder.AllowAnyOrigin()
          .AllowAnyMethod()
          .AllowAnyHeader()
          .AllowCredentials());
  
      app.UseMvc();
  }
  </code></pre>