title: Remove top levels of stacktrace from Log4Net
body: <p>I have a log4net implementation that is kept in a class and that class is accessed from a static <code>ExceptionHandler</code> class (to avoid changing a bunch of usages, as this is a legacy codebase). So, when exceptions are logged, they look like this:</p>
  
  <pre><code>System.Timers.Timer.MyTimerCallback &gt; 
  InternalMethod1 &gt; 
  InternalMethod2 &gt; 
  ExceptionHandler.HandleException &gt; 
  Logger.Log
  </code></pre>
  
  <p>I really don't want these last two to be present in the call stack because they obfuscate where the error was actually logged from, which is in <code>InternalMethod2</code>. However, the only way I see of doing this is to expose the actual logger to <code>InternalMethod2</code> and I don't want to do that either.</p>
  
  <p>Is there a way I can curate my stacktrace so that it displays the situation accurately?</p>
  
  <p>My Logger Class:</p>
  
  <pre><code>public class Logger : ILogger
  {
      public void Log(Exception ex, string message)
      {
          log4net.LogManager.Get("MyLog").Error(ex, message);
      }
  }
  </code></pre>
  
  <p>My ExceptionHandler class:</p>
  
  <pre><code>public static class ExceptionHandler
  {
      private readonly static Logger MyLogger = new Logger();
  
      HandleException(Exception ex, string message)
      {
          MyLogger.Log(ex, message);
      }
  }
  </code></pre>
  
  <p>My call in <code>InternalMethod2</code>:</p>
  
  <pre><code>void InternalMethod2()
  {
      // do some stuff
      try
      {
          // do other stuff
      }
      catch (Exception e)
      {
          ExceptionHandler.HandleException(e, "An error occurred");
      }
  }
  </code></pre>