josephwoodward / GlobalExceptionHandlerDotNet

Exception handling as a convention in the ASP.NET Core request pipeline
MIT License
272 stars 32 forks source link

Unhandled exception log #15

Open lsgroi opened 6 years ago

lsgroi commented 6 years ago

As far as I understand, the library is built on top of ExceptionHandlerMiddleware by setting its exception handler.

By default the exception is logged as "unhandled exception" after which is handled by the library via ExceptionHandlerConfiguration.

This is causing a message "An unhandled exception has occurred: ..." sent to the logger. What would you suggest to avoid that behaviour?

dharanish commented 5 years ago

Hi @JosephWoodward, Could you please suggest any workaround/fix for Unhandled exception logs logged by ExceptionHandlerMiddleware.

For ex: 2019-01-28 14:09:10.3817|ERROR|Microsoft.AspNetCore.Diagnostics.ExceptionHandlerMiddleware||An unhandled exception has occurred while executing the request. A network-related or instance-specific error occurred while establishing a connection to SQL Server.....

This is also logged when OnError logging.