title: Correctly Injecting Serilog into .net core classes as Microsoft.Extentions.Logging.ILogger - Not ASP .Net Core
body: <p>So I have a .Net Core Console application and a bunch of .Net core Libraries.</p>
  
  <p>Most of the classes in the libraries have constructors like this.</p>
  
  <pre><code>public class ReportingManager
  {
     private ILogger _logger;
     Public ReportingManager(ILogger logger)
     {
        _logger = logger;
     }
  }
  </code></pre>
  
  <p>with <code>ILogger</code> being of type <code>Microsoft.Extentions.Logging.ILogger</code></p>
  
  <p>In my Console app I have this.</p>
  
  <pre><code>class Program
  {
      static void Main(string[] args)
      {           
              var serilog = new LoggerConfiguration()
                  .MinimumLevel.Debug()
                  .MinimumLevel.Override("Microsoft", Serilog.Events.LogEventLevel.Warning)
                  .Enrich.FromLogContext()
                  .WriteTo.Console(theme: AnsiConsoleTheme.Code)
                  .CreateLogger();
  
              ReportingManager manager = new ReportingManager(serilog);
  
      }
  }
  </code></pre>
  
  <p>I have an intellisense error at 'ReportingManager manager = new ReportingManager(serilog);'</p>
  
  <blockquote>
    <p>cannot convert from 'Serilog.Core.Logger' to 'Microsoft.Extensions.Logging.ILogger'</p>
  </blockquote>
  
  <p>So my question is, how do I pass in Serilog correctly?</p>
  
  <p>Had a look online and here but most talk about ASP.Net Core.</p>