AspNetCore. Middleware. Connector
See the version list below for details.
dotnet add package ProblemDetails.Serilog.AspNetCore.Middleware.Connector --version 6.0.0
NuGet\Install-Package ProblemDetails.Serilog.AspNetCore.Middleware.Connector -Version 6.0.0
<PackageReference Include="ProblemDetails.Serilog.AspNetCore.Middleware.Connector" Version="6.0.0" />
paket add ProblemDetails.Serilog.AspNetCore.Middleware.Connector --version 6.0.0
#r "nuget: ProblemDetails.Serilog.AspNetCore.Middleware.Connector, 6.0.0"
// Install ProblemDetails.Serilog.AspNetCore.Middleware.Connector as a Cake Addin #addin nuget:?package=ProblemDetails.Serilog.AspNetCore.Middleware.Connector&version=6.0.0 // Install ProblemDetails.Serilog.AspNetCore.Middleware.Connector as a Cake Tool #tool nuget:?package=ProblemDetails.Serilog.AspNetCore.Middleware.Connector&version=6.0.0
Serilog Diagnostic Context
Serilog provides a convenient Diagnostic Context capable of capturing an exception that occured at some point during a request. The
RequestLoggingMiddleware installed by
UseSerilogRequestLogging logs the exception captured in the context when there is no unhandled exception flying.
Exception Capturing Middleware
This package provides exception capturing middleware that can be registered using a call to the
UseSerilogRequestLoggingCaptureException extension method. This very simple middleware writes any exceptions encountered to Serilog's Diagnostic Context, without catching them.
UseSerilogRequestLoggingAndProblemDetails, described below, this middleware does not need to be registered explicitly.
Serilog alongside Problem Details
This package provides a
UseSerilogRequestLoggingAndProblemDetails extension method that can be used in place of Serilog's
UseSerilogRequestLogging and Hellang's
UseProblemDetails. It also registers the exception capturing middleware provided by this package, via a call to
UseSerilogRequestLoggingCaptureException. The middleware registration order is:
The resulting behavior is that exceptions thrown from requests (ex. from MVC controller action methods) are writen to the diagnostic context, then caught by Problem Details, then logged by Serilog.
Problem Details configuration
This package provides a
AddProblemDetailsAlongsideSerilog extension method that can be used in place of Hellang's
AddProblemDetails. It calls Hellang's
AddProblemDetails, but with options defaulted to request that Problem Details doesn't consider as "unhandled", and therefore doesn't log, any exceptions. The options used look like this:
options.ShouldLogUnhandledException = (httpContext, exception, problemDetails) => false;
- When configuring the application's request pipeline, Call
- When configuring the application's services, Call
|Product||Versions Compatible and additional computed target framework versions.|
|.NET||net6.0 is compatible. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed.|
This package is not used by any NuGet packages.
This package is not used by any popular GitHub repositories.