AsyncWrapper Does Not Work With AutoFlush

17 megtekintés
Ugrás az első olvasatlan üzenetre

Patrick Skelton

olvasatlan,
2017. jún. 20. 7:28:222017. 06. 20.
– NLog-Users
I have an NLog setup that attempts to send an email when an error occurs.  The error message is fairly long.  It is built by reading the whole contents of an NLog MemoryTarget and writing this into the email.  So, if one of these error messages gets sent when you are using the UI of the application, there is a noticeable delay while the email is sent.

Wrapping the MailTarget in an AsyncWrapper fixes this problem, but it leaves the problem that the email gets sent with some lines missing.  If I wrap the MailTarget in an AutoFlushWrapper, I get all the lines but I am back to the problem of having the UI freeze while the email is sent.

If I try to wrap the MailTarget in both an AutoFlushWrapper and an AsyncWrapper, the former appears to take precedence and the latter seems to be ignored or at least it doesn't appear to work, because I go back to the UI freezing.

Does anyone know if there is a reported problem with these two working together?  And does anyone know of a way I might fix this?


Válasz mindenkinek
Válasz a szerzőnek
Továbbítás
0 új üzenet