title: Finding issue on Log4Net null reference exception
body: <p>I'm running a strange issue using log4net (2.0.8) which is spamming "null references" exceptions</p>
  
  <p>Once I've attached the pdb and browsed the source file if fall here (EventLogAppender.cs)</p>
  
  <pre><code>if (eventTxt.Length &gt; MAX_EVENTLOG_MESSAGE_SIZE)
              {
                  eventTxt = eventTxt.Substring(0, MAX_EVENTLOG_MESSAGE_SIZE);
              }
  </code></pre>
  
  <p>I've made a action break point and traced the value of eventTxt just it logs
  "149"
  However it enters in the if condition then throws an exception</p>
  
  <p>here is a screenshot of visual
  <a href="https://i.stack.imgur.com/wEmXT.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/wEmXT.png" alt="Visual studio blocking on exception"></a>
  I suspect a code optimization to lead to a different reality than what i see.. Did I miss anything ?</p>
  
  <p>Thanks</p>