-
Notifications
You must be signed in to change notification settings - Fork 72
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Console logging sometimes causes application to hang #84
Comments
Thanks for the report, Lachlan. Still no ideas, here, but some more data might help uncover some possibilities. Is there any chance you can collect stack traces for the hung threads? Also, is |
Hello, we just had the same issue on our development environment on full .NET Framework console application. And that totally fixed it. Developer/User to just get focus on console window clicked in background which changes the console window title bar and ads a previx like |
We have verified that this is a problem as well in our production environment. After inspecting process dumps we could see that several threads was indeed waiting on the lock. After disabling console logging, the service performance improved significantly. |
Thanks for the note, @rasmus - console logging performance can definitely be a bottleneck in some runtime environments. Using Serilog.Sinks.Async can improve console logging performance. As the original issue here was regarding a hang, and the post above appears to successfully diagnose the cause, I think your scenario is different. If you still hit poor performance after wrapping your console logging in |
Does this issue relate to a new feature or an existing bug?
What version of Serilog Console Sink is affected by this issue? Please list the related NuGet package.
Serilog.AspNetCore - version 3.1.0
Serilog.Sinks.Console - version 3.1.1
What is the target framework and operating system affected by this issue? Please see target frameworks & net standard matrix.
Running on windows 10 under IIS, dot net core 2.1.15.
Please describe the current behaviour you are experiencing?
When running my app sometimes my application hangs and stops responding. It's really difficult for me to reproduce. After much debugging I am pretty sure it's the console logger hanging for some reason as I did a memory dump and found 7 threads all sitting on the
Serilog.Sinks.Console.dll!Serilog.Sinks.SystemConsole.ConsoleSink.Emit()
method.Removing the
.WriteTo.Console()
line shown below 'fixed' the problem.
Please describe the expected behaviour if the ?
Not hanging :)
If the current behavior is a bug, please provide the steps to reproduce the issue and if possible a minimal demo of the problem
NOTE: A small code sample goes a long way in expediting bug fixes or illustrating an enhancement you are proposing.
I am really sorry I can't provide a minimal set of code to reproduce the issue. I am using Serilog.aspnetcore 3.1.0 and Seq, and my startup code looks like this:
My log cleaner looks like this:
It seems to often happen at machine startup - when Seq is not running. I'm not sure if that's related.
The text was updated successfully, but these errors were encountered: