-
Notifications
You must be signed in to change notification settings - Fork 208
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
.NET 8 Global Exception Handler logs twice. #374
Comments
Isn't this issue already known when implementing IExceptionHandler and the workaround is setting the logging to None for ExceptionHandlingMiddleware "Logging": { |
Yes, I forgot to show that I enabled that setting too. |
I've experienced the same behaviour and I don't know how to solve it. |
LoggerTest.zip |
This looks like a duplicate of #341 |
Having a means to turn off exception logging in |
Are we sure this is the same issue as #341. Because currently we are facing the problem of tripple logs. Like it is seen here and in the other issue. We do not have Edit: It seems to be the issue mentioned here dotnet/aspnetcore#54554 |
Description
As title suggests, using Global Exception handler logs twice on exceptions but not on simple logs. This happens both on console and file sink, so I don't think the issue is with the sink but rather on the Global Exception Handler.
Demo:
Here, logs are logged fine.
Here is the unexpected behaviour.
Reproduction
The appsettings.json:
The program.cs:
The GlobalExceptoinHandler.cs:
Expected behavior
Expected to see only one log event when an exception is thrown.
Relevant package, tooling and runtime versions
The text was updated successfully, but these errors were encountered: