title: Conditional logging with log4net
body: <p>I have a program that uses log4Net using both text and smtp appenders.</p>
  
  <p>When the program runs several logging are captured by the smtp appenders and are buffered waiting for the program end before sending mail.</p>
  
  <p>When the program is nearly completed I might discover that I do not need to send emails, and actually I log something like "Nothing to do".</p>
  
  <p>I know that it is possible to manipulate by code the appenders configuration so I could suppress the mail setting the Threshold to off.</p>
  
  <p>I would like to know if it is possible to get the same result using just log4net configuration: the smtp appender should not send an email if a specific string is logged at any time. If instead that string is not logged it should behave normally and send all the lines that match the defined filters.</p>