title: C# derived class type needed in base for logging using NLog
body: <p>We're using NLog for logging in an C# MVC3 web application.  All of our controllers extend a custom base "ApplicationController" that gives us access to a constantly needed methodes and s members.</p>
  
  <p>I'd like all controllers to have access to the Logger via this base class, but want the detail of knowing what derived class the log statements originated in.</p>
  
  <p>Our application controller looks like this:</p>
  
  <pre><code>public abstract class ApplicationController : Controller
  {
      protected Logger _logger;
      protected virtual Logger Logger
      {
          get { return _logger ?? (_logger = LogManager.GetCurrentClassLogger()); }
      }
  
      protected ApplicationController()
      {
          Context = new Entities();
      }
  </code></pre>
  
  <p>If a derived controller doesn't override the Logger than all statements will show they originated from the Application controller.  Currently, I've got essentially the same Logger statement in all derived controllers.  For example:</p>
  
  <pre><code>public class PropertyController : ApplicationController
  {
      private readonly DatatapeService _datatapeService;
      private readonly PropertyService _propertyService;
      protected override Logger Logger
      {
          get { return _logger ?? (_logger = LogManager.GetCurrentClassLogger()); }
      }
  </code></pre>
  
  <p>Obviously this is poor implementation practice.</p>
  
  <ol>
  <li>How can I dry this up?  Specifically, what is my understanding of C#
  lacking to accomplish exactly this specific task? </li>
  <li>Is there a logging pattern that I should be following where I'm not exposing the
  logging class (NLog) directly?</li>
  </ol>
  
  <p>TIA!</p>