I have found this
link which works well without having to write your class above.
<targets>
<target name="console" xsi:type="Console" />
<target name="papercut" xsi:type="BufferingWrapper" bufferSize="100">
<target xsi:type="PostFilteringWrapper" defaultFilter="level >= LogLevel.Error">
<target xsi:type="Mail"
name="papercut"
subject="Your app has errors"
to="somebody@domain.net"
from="someemail@domain.net"
smtpServer="localhost" />
<when exists="level >= LogLevel.Error" filter="level >= LogLevel.Info"/>
</target>
</target>
</targets>
<rules>
<logger name="*" minlevel="Debug" writeTo="console" />
<logger name="*" minlevel="Debug" writeTo="papercut" />
</rules>
C++ and C# Developer for 21 years. Microsoft Certified.
UK Senior software developer / team leader.
I've been writing software since 1985. I pride myself on designing and creating software that is first class. That means it has to be fast, scalable, and with good use of design patterns.
I have done everything from risk analysis and explosion modelling, banking systems, to highly scalable multi-threaded arrival and departure screens in many leading airports, to state of the art wireless warehouse systems.