Ogu.Extensions.Logging.HttpMiddleware
1.0.3
.NET 5.0
This package targets .NET 5.0. The package is compatible with this framework or higher.
.NET Core 3.1
This package targets .NET Core 3.1. The package is compatible with this framework or higher.
.NET Standard 2.0
This package targets .NET Standard 2.0. The package is compatible with this framework or higher.
There is a newer version of this package available.
See the version list below for details.
See the version list below for details.
dotnet add package Ogu.Extensions.Logging.HttpMiddleware --version 1.0.3
NuGet\Install-Package Ogu.Extensions.Logging.HttpMiddleware -Version 1.0.3
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Ogu.Extensions.Logging.HttpMiddleware" Version="1.0.3" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Ogu.Extensions.Logging.HttpMiddleware --version 1.0.3
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: Ogu.Extensions.Logging.HttpMiddleware, 1.0.3"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install Ogu.Extensions.Logging.HttpMiddleware as a Cake Addin #addin nuget:?package=Ogu.Extensions.Logging.HttpMiddleware&version=1.0.3 // Install Ogu.Extensions.Logging.HttpMiddleware as a Cake Tool #tool nuget:?package=Ogu.Extensions.Logging.HttpMiddleware&version=1.0.3
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
Ogu.Extensions.Logging.HttpMiddleware enhances logging capabilities within ASP.NET Core applications by providing middleware <small>(Similar to Serilog's <sup><sub>RequestLoggingMiddleware.cs</sub></sup>
Usage
Registration:
app.UseHttpLoggingMiddleware(opts =>
{
opts.IncludeQueryInRequestPath = false;
opts.IncludeRequestBody = false;
opts.IncludeRequestHeaders = false;
opts.IncludeResponseBody = false;
opts.IncludeResponseHeaders = false;
opts.RedactRequestHeaders = new string[]
{
"Cookie"
};
});
output
[2024-05-23T14:10:30.3705202Z-Dev-inf]: Ogu.Extensions.Logging.HttpLoggingMiddleware
GET /api/samples responded 200 (OK) in 21.7721ms
Enrich CorrelationId (Extra)
app.UseHttpLoggingMiddleware(opts =>
{
opts.EnrichLoggingContextOnResponseStarting = (loggingContext, httpContext) =>
{
httpContext.AddCorrelationIdHeaderIfMissing(loggingContext);
};
});
[2024-05-27T23:19:33.0434168Z-Dev-inf]: Ogu.Extensions.Logging.HttpLoggingMiddleware
[f2cd6f70-9c58-4af0-a3dd-e05571404889] GET /api/Samples responded 200 (OK) in 28.5559ms
Sample Application
A sample application demonstrating the usage of Ogu.Extensions.Logging.HttpClient & Ogu.Extensions.Logging.HttpMiddleware be found here.
Links:
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net5.0 is compatible. net5.0-windows was computed. 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 is compatible. 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 is compatible. net8.0-android was computed. net8.0-browser 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. |
.NET Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 is compatible. |
.NET Standard | netstandard2.0 is compatible. netstandard2.1 is compatible. |
.NET Framework | net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
MonoAndroid | monoandroid was computed. |
MonoMac | monomac was computed. |
MonoTouch | monotouch was computed. |
Tizen | tizen40 was computed. tizen60 was computed. |
Xamarin.iOS | xamarinios was computed. |
Xamarin.Mac | xamarinmac was computed. |
Xamarin.TVOS | xamarintvos was computed. |
Xamarin.WatchOS | xamarinwatchos was computed. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
.NETCoreApp 3.1
- Ogu.Extensions.Logging.Abstractions (>= 1.0.3)
-
.NETStandard 2.0
- Microsoft.AspNetCore.Http (>= 2.2.0)
- Ogu.Extensions.Logging.Abstractions (>= 1.0.3)
-
.NETStandard 2.1
- Microsoft.AspNetCore.Http (>= 2.2.0)
- Ogu.Extensions.Logging.Abstractions (>= 1.0.3)
-
net5.0
- Ogu.Extensions.Logging.Abstractions (>= 1.0.3)
-
net6.0
- Ogu.Extensions.Logging.Abstractions (>= 1.0.3)
-
net7.0
- Ogu.Extensions.Logging.Abstractions (>= 1.0.3)
-
net8.0
- Ogu.Extensions.Logging.Abstractions (>= 1.0.3)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.