title: Implementation and usage of logger wrapper for log4net
body: <p>This question is related to <a href="https://stackoverflow.com/users/264697/steven">Steven</a>’s answer - <a href="https://stackoverflow.com/a/5646876/4908919">here</a>. He proposed a very good logger wrapper. I will paste his code below:</p>
  
  <pre><code>public interface ILogger
  {
      void Log(LogEntry entry);
  }
  
  public static class LoggerExtensions
  {
      public static void Log(this ILogger logger, string message)
      {
          logger.Log(new LogEntry(LoggingEventType.Information,
              message, null));
      }
  
      public static void Log(this ILogger logger, Exception exception)
      {
          logger.Log(new LogEntry(LoggingEventType.Error, 
              exception.Message, exception));
      }
  
      // More methods here.
  }
  </code></pre>
  
  <p>So, my question is <strong>what is the proper way to create implementation that proxies to log4net</strong>? Should I just add another Log extension method with type parameter and then create a switch inside? Use different log4net method in case of <code>LoggingEventType</code> ?</p>
  
  <p>And second question, <strong>what is the best way to use it later in the code?</strong> </p>
  
  <p>Because he wrote:</p>
  
  <blockquote>
    <p>(…) you can easily create an ILogger implementation (…) and configure
    your DI container to inject it in classes that have a ILogger in their
    constructor.</p>
  </blockquote>
  
  <p>Does that mean that every class that will log sth (so basically every), should have <code>ILogger</code> in its constructor? </p>