NLog: Force BufferingTargetWrapper to empty on AppDomain UnhandledException
Posted
by Superdumbell
on Stack Overflow
See other posts from Stack Overflow
or by Superdumbell
Published on 2010-03-09T23:05:11Z
Indexed on
2010/03/12
4:37 UTC
Read the original article
Hit count: 542
I have NLog configured in my application to to use the BufferingTargetWrapper for sending emails with the MailTarget.
The problem I'm running into is I can not find a way to force NLog to empty the BufferingTargetWrapper before the application exits from Unhandled Exceptions.
I tried calling LogManager.Flush() and LogManager.DisableLogging() from the Current App Domain's UnhandledException Event but it does not seam to work.
What would I need to do to make it send the emails?
© Stack Overflow or respective owner