title: How to wire up AutoFac to Common.Logging?
body: <p>I have a class like so:</p>
  
  <pre><code>public class LoggedFoo
  {
      private readonly ILog _logger;
  
      public LoggedFoo(ILog logger)
      {
          this._logger = logger;
      }
  
      public DoStuff()
      {
          this._logger.Info(i =&gt; i("Doing stuff..."));
      }
  }
  </code></pre>
  
  <p>One of the business requirements is that logs are being generated for certain functions, so naturally I want to mock out the <code>ILog</code> to verify.</p>
  
  <p>However, Common.Logging library supports type-based loggers, along the lines of:</p>
  
  <pre><code>var logger = LogManager.GetLogger&lt;LoggedFoo&gt;();
  </code></pre>
  
  <p>...or:</p>
  
  <pre><code>var logger = LogManager.GetLogger(typeof(LoggedFoo));
  </code></pre>
  
  <p>The problem is, we are using AutoFac for dependency injection, and I cannot figure out how to instantiate an <code>ILog</code> based upon the class that is being instantiated for injection.</p>
  
  <p>How do I write this?  I am using the latest Nuget version of AutoFac.</p>