title: Pass a logger to a static class
body: <p>I have a static class in the production. For some reason, we need to replace the logging part methods in this class.(Still a static class unchanged)</p>
  
  <p>Now I want to pass a logger to it. The logger is from another class.</p>
  
  <pre><code>public static class OutputUtils   
  public static void LogInfo(string logMessage)
  {
      logger.LogInfo(logMessage);
  }
  </code></pre>
  
  <p>In another class, I have </p>
  
  <pre><code>private readonly ILogger _logger;
  public AnotherClass(ILogger logger)
  {
      _logger = logger;
  }
  internal static void LogDebug(string logMessage)
  {
      OutputUtils.LogInfo(logMessage);
  }
  </code></pre>
  
  <p>Yes, I want to pass <code>_logger</code> to the static class <code>OutputUtils</code>.
  How?</p>