title: Map ILogger to Serilog's Logger after ASP.NET Core 2 logging update
body: <p>From <a href="https://stackoverflow.com/users/138206/nicholas-blumhardt">@nblumhardt</a>'s <a href="https://nblumhardt.com/2017/08/use-serilog/" rel="noreferrer">post</a>:</p>
  
  <blockquote>
    <p>You can then go ahead and delete any other logger configuration that’s hanging around: there’s no need for a "Logging" section in appsettings.json, no AddLogging() anywhere, and no configuration through ILoggerFactory in Startup.cs.</p>
  </blockquote>
  
  <p>I am getting an exception when <code>using Serilog;</code> and <code>ILogger</code> in my controller.</p>
  
  <pre><code>private readonly ILogger _logger;
  
  public CustomersController(ILogger logger)
  {
      _logger = logger;
  }
  </code></pre>
  
  <p>Results in:</p>
  
  <blockquote>
    <p>An unhandled exception occurred while processing the request.<br>
    InvalidOperationException: Unable to resolve service for type 'Serilog.ILogger' while attempting to activate 'Customers.Api.Controllers.CustomersController'.</p>
  </blockquote>
  
  <p>Would I still need to provide some information to DI in the <code>Startup.ConfigureServices()</code> method?</p>
  
  <p>My Program class, to my knowledge, follows instructions in the post.</p>
  
  <pre><code>public class Program
  {
      public static void Main(string[] args)
      {
          Log.Logger = new LoggerConfiguration()
              .MinimumLevel.Debug()
              .MinimumLevel.Override("Microsoft", LogEventLevel.Information)
              .Enrich.FromLogContext()
              .WriteTo.Console()
              .CreateLogger();
  
          BuildWebHost(args).Run();
      }
  
      public static IWebHost BuildWebHost(string[] args) =&gt;
          WebHost.CreateDefaultBuilder(args)
              .UseStartup&lt;Startup&gt;()
              .UseSerilog()
              .Build();
  }
  </code></pre>