Console target stops receiving messages (Resolved)

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Console target stops receiving messages (Resolved)

alpha_cast
This post was updated on .
Hi all,

I've got a fairly long running console application which generates dummy data and sends it to a WCF. I've got NLog logging to the coloured console target, and to a file.

Quite often the console simply stops receiving log messages after a while, but the program continues and the file target does receive all of them. The console window isn't frozen. If I call "LogManager.Flush();" after this happens, then it throws the following:

NLog.NLogRuntimeException: Asynchronous exception has occurred. ---> System.TimeoutException: Timeout.
   --- End of inner exception stack trace ---
   at NLog.Common.AsyncHelpers.RunSynchronously(AsynchronousAction action)
   at NLog.LogFactory.Flush(TimeSpan timeout)
   at NLog.LogFactory.Flush()
   at NLog.LogManager.Flush()
   at WcfMocking.Program.Main(String[] args)

Any ideas what's going on here? It seems like it could be related to this, except that I'm on Windows and using .NET. Last time it happened within 90 seconds of the program starting, but often it's a bit longer. The program is running on a virtual server which I remote desktop into.

Cheers.
Reply | Threaded
Open this post in threaded view
|

Re: Console target stops receiving messages

alpha_cast
Apologies for the false alarm, this seems to be my own dumb fault.

The particular virtual server I was running it on is set up differently than the other computers/servers I work on, so that left clicking inside the console window causes text to be selected, which stops the console from displaying log messages until the selection is cleared. Then  I guess LogManager.Flush() throws because it's not able to actually display the messages or something like that.

Annoying issue that's been getting too me for a while, but I should have done some more digging.