title: Ninject, how inject a generic Logger<T> by calling LoggerFactory.CreateLogger
body: <p>I am working on an ASP.NET MVC application.</p>
  
  <p>I have initialized my LoggerFactory in a static class which is called from Global.asax</p>
  
  <pre><code>using Microsoft.Extensions.Logging;
  using Serilog;
  using System.IO;
  
  namespace web
  {
      public static class LogConfig
      {
          public static LoggerFactory LoggerFactory = new LoggerFactory();
  
          public static void RegisterLogger()
          {
              LoggerFactory = new LoggerFactory();
              Log.Logger = new LoggerConfiguration().MinimumLevel.Debug().WriteTo.RollingFile(Path.Combine("", "log-{Date}.txt")).CreateLogger();
              LoggerFactory.AddSerilog();
          }
      }
  }
  </code></pre>
  
  <p>now I want to use ninject, to inject an instance of ILogger into my constructor...</p>
  
  <p>In my constructor I have:</p>
  
  <pre><code>private ILogger&lt;MyTypeController&gt; _logger;
  
  public MyTypeController(ILogger&lt;MyTypeController&gt;) 
  {
      // This works fine but I want to inject it
      _logger = LogConfig.LoggerFactory.CreateLogger&lt;MyTypeController&gt;();
  }
  </code></pre>
  
  <p>The above code works, but I want to inject it using ninject... this is what I have tried but does not even compile:</p>
  
  <pre><code>kernel.Bind(typeof(ILogger&lt;&gt;)).ToProvider(LogConfig.LoggerFactory.CreateLogger&lt;&gt;());
  </code></pre>