Add ExceptionHandlerOptions.SuppressLoggingOnHandledException
#59075
Labels
api-ready-for-review
API is ready for formal API review - https://github.com/dotnet/apireviews
area-middleware
Includes: URL rewrite, redirect, response cache/compression, session, and other general middlesware
Milestone
Background and Motivation
A config option to only log in exception handler middleware if the exception is unhandled.
For #54554
Proposed API
namespace Microsoft.AspNetCore.Builder; public class ExceptionHandlerOptions { + public bool SuppressLoggingOnHandledException { get; set; } }
Defaults to false.
Usage Examples
Alternative Designs
Could make the new behavior the default. I don't think that is a good idea for backwards compatibility reasons, and some people might prefer the current behavior.
Risks
The text was updated successfully, but these errors were encountered: