I have a .net service that processes messages. For any crashes, I use log4net and write to a file. I have added an SMTP application for this. The problem is that I want to send only one message when something goes wrong. MaxRetries in my app.config is set to 5, and rightly so, 5 errors are logged in the log4net file, but 5 emails are also sent.
Is there a way to get the max repeat descriptor and start my email when it is reached?
Thank you for your help.
source
share