title: ASP.NET MVC Controller extension method to make Log available to all controllers
body: <p>Is it possible to extend the Controller type in Asp.net MVC to make a method available to all controller classes for application logging?<br>
  I've tried this:  </p>
  
  <pre><code>public static class ControllerExtensions
      {
          public static ILog Log(this Controller controller)
          {
              log4net.Config.XmlConfigurator.Configure();
              return log4net.LogManager.GetLogger(controller.GetType());
          }
      }
  </code></pre>
  
  <p>But, if I try to access the method as in:  </p>
  
  <pre><code>Controller.Log.Info("hello");
  </code></pre>
  
  <p>It won't compile with the error message: <em>'System.Web.Mvc.Controller' does not contain a definition for 'Log'</em>  </p>
  
  <p>I do have a using statement bringing the static class into scope. </p>
  
  <p>Any help would be great.<br>
  Jacques</p>