title: ASP.NET Core EventLog provider
body: <p>I have a project using .NET Framework ASP.NET Core 2.0, and want to implement logging to windows event log, like i read <a href="https://docs.microsoft.com/en-us/aspnet/core/fundamentals/logging/?tabs=aspnetcore2x" rel="noreferrer">here</a></p>
  
  <p>Add log providers</p>
  
  <pre><code>public class Program
  {
          public static void Main(string[] args)
          {
              BuildWebHost(args).Run();
          }
  
          public static IWebHost BuildWebHost(string[] args) =&gt;
              WebHost.CreateDefaultBuilder(args)
              .ConfigureLogging((hostingContext, logging) =&gt;
              {
                  logging.AddConfiguration(hostingContext.Configuration.GetSection("Logging"));
                  logging.AddEventSourceLogger();
                  logging.AddConsole();
              })
              .UseStartup&lt;Startup&gt;()
              .Build();
      }
  </code></pre>
  
  <p>Controller</p>
  
  <pre><code>[Route("api/[controller]")]
  public class ShortCodeController : Controller
  {
          private readonly ILogger _logger;
  
          public ShortCodeController(ILogger&lt;ShortCodeController&gt; logger)
          {
              _logger = logger;
  
              _logger.LogInformation("INIT");
          }
  
          [HttpGet("{letters}/{digits}/{length}")]
          public string Get(bool letters, bool digits, int length)
          {
              _logger.LogError("TEST");
  
              return "value";
          }
      }
  </code></pre>
  
  <p>And it works for console,  I see my log messages. But i can't find that messages in event log using event viewer. Why?</p>