Eigenverft.WebLib.RequestTrafficLogging
1.0.0.10-g40a2f17cdc
dotnet add package Eigenverft.WebLib.RequestTrafficLogging --version 1.0.0.10-g40a2f17cdc
NuGet\Install-Package Eigenverft.WebLib.RequestTrafficLogging -Version 1.0.0.10-g40a2f17cdc
<PackageReference Include="Eigenverft.WebLib.RequestTrafficLogging" Version="1.0.0.10-g40a2f17cdc" />
<PackageVersion Include="Eigenverft.WebLib.RequestTrafficLogging" Version="1.0.0.10-g40a2f17cdc" />
<PackageReference Include="Eigenverft.WebLib.RequestTrafficLogging" />
paket add Eigenverft.WebLib.RequestTrafficLogging --version 1.0.0.10-g40a2f17cdc
#r "nuget: Eigenverft.WebLib.RequestTrafficLogging, 1.0.0.10-g40a2f17cdc"
#:package Eigenverft.WebLib.RequestTrafficLogging@1.0.0.10-g40a2f17cdc
#addin nuget:?package=Eigenverft.WebLib.RequestTrafficLogging&version=1.0.0.10-g40a2f17cdc&prerelease
#tool nuget:?package=Eigenverft.WebLib.RequestTrafficLogging&version=1.0.0.10-g40a2f17cdc&prerelease
Eigenverft.WebLib.RequestTrafficLogging
ASP.NET Core request traffic logging that combines framework HTTP capture with one structured completion record and explicit outcome semantics.
✨ At a glance
| Capability | Details |
|---|---|
| Record | One combined request/response record with pipeline outcome and duration. |
| Capture | Framework HTTP Logging provides optional bounded body capture; the default fields are Core and Routing. |
| Header safety | Allow-listed headers and sensitive-value redaction are the defaults. |
| Dependency | Uses Eigenverft.WebLib.ClientNetwork transitively for optional forwarded-IP details. |
📦 Installation
dotnet add package Eigenverft.WebLib.RequestTrafficLogging
🚀 Quick start
using Eigenverft.WebLib.RequestTrafficLogging;
builder.Services.AddRequestTrafficLogging();
WebApplication app = builder.Build();
app.UseRequestTrafficLogging();
The package registers and activates ASP.NET Core UseHttpLogging() internally. Do not add a second UseHttpLogging() in the same linear pipeline. Place UseRequestTrafficLogging() before exception-handling middleware when handled exceptions should be classified as faulted with their final response status.
Record shape and completion semantics
The default record uses hierarchical property names in a stable diagnostic order:
- request:
Request.*,Request.Header.*, andRequest.Body.* - connection:
Connection.Remote.*,Connection.Local.*, and forwarded-IP information - identity and routing:
Identity.*andRouting.* - response:
Response.*,Response.Header.*, andResponse.Body.* - pipeline result:
Pipeline.Outcome,Pipeline.Aborted,Pipeline.DurationMs, andPipeline.ExceptionType
Pipeline.Outcome describes how the middleware pipeline finished; it is independent of the HTTP status:
Completed: the downstream pipeline returned normally and no handled-exception feature remained. This can coexist withPipeline.Aborted: truewhen the cancellation signal was observed only at the final snapshot, as commonly happens after a completed streaming or SSE response.Aborted: anOperationCanceledExceptionorIOExceptionescaped whileRequestAbortedwas set.Faulted: another exception escaped, or the exception-handler feature reports an exception that was handled into a response.
Pipeline.Aborted is the raw value of RequestAborted.IsCancellationRequested at completion and does not by itself determine Pipeline.Outcome. Response.Started is sampled at the same point. Connection.ForwardedIpChain is rendered as a readable ->-separated chain.
The body text itself remains the framework-owned RequestBody or ResponseBody field. Its related WebLib metadata uses Request.Body.ContentType, Request.Body.DeclaredLength, Request.Body.Truncated and the corresponding Response.Body.* names. DeclaredLength is the HTTP Content-Length when known, not a byte counter invented by the logger. Body field groups are opt-in; configured body limits default to 4 KiB.
To populate forwarded-IP details, enable app.UseClientNetworkFeature() before the logging middleware. The feature's position relative to trusted Forwarded Headers determines which remote peer address it observes.
Header capture and sensitivity
For a deliberate full-header diagnostic session, opt in to raw header capture:
builder.Services.AddRequestTrafficLogging(options =>
{
options.Fields = RequestTrafficLoggingFields.All;
options.HeaderCaptureMode = HeaderCaptureMode.AllRaw;
});
AllRaw captures every incoming request and outgoing response header value, including previously unknown header names, bearer credentials and cookies. Multiple values are recorded individually as Request.Header.Name[0], Request.Header.Name[1], and similarly under Response.Header.*. The default AllowListed mode and SensitiveValueMode behavior remain unchanged. Raw mode requires the corresponding RequestHeaders or ResponseHeaders field flag and does not expand body limits or change middleware placement. Protect the resulting logs accordingly.
🎯 Target frameworks
Targets net8.0 and net10.0; .NET 9 applications can consume the compatible net8.0 asset.
🔗 Project links
📄 License
MIT; see the repository license.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | 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. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net10.0
- Eigenverft.WebLib.ClientNetwork (>= 1.0.0.6-g40a2f17cdc)
-
net8.0
- Eigenverft.WebLib.ClientNetwork (>= 1.0.0.6-g40a2f17cdc)
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 1.0.0.10-g40a2f17cdc | 0 | 9/28/2026 |
| 1.0.0.10-g3f72d1412c | 0 | 9/29/2026 |
| 1.0.0.3-gbfce1c5596 | 0 | 9/28/2026 |
| 1.0.0.3-g8afd56e9dc | 0 | 9/12/2026 |
Corrected Pipeline.Outcome cancellation semantics.
- Keeps Pipeline.Outcome=Completed when the downstream pipeline returned normally, even if RequestAborted is set at the final snapshot.
- Reserves Pipeline.Outcome=Aborted for an escaping OperationCanceledException or IOException accompanied by the cancellation signal.
- Keeps Pipeline.Aborted as the independent raw cancellation signal, so completed streaming and SSE responses can report Completed together with Pipeline.Aborted=true.
- Preserves all hierarchical field names introduced in 1.0.0.7.
- This is a breaking behavioral change for log queries or dashboards that treated every observed cancellation signal as Pipeline.Outcome=Aborted.
Introduced hierarchical traffic diagnostics fields as the default output contract.
- Groups fields under Request.*, Connection.*, Identity.*, Routing.*, Response.*, and Pipeline.*.
- Emits both allowlisted and raw headers under Request.Header.* and Response.Header.*.
- Renames body length metadata to *.Body.DeclaredLength to reflect Content-Length semantics.
- Orders the controlled fields from request input through response and final pipeline outcome.
- This is a breaking field-name change for log queries and dashboards; framework body text remains RequestBody/ResponseBody.
Previously clarified traffic diagnostics fields for flat log output.
- Renamed Outcome to PipelineOutcome and ResponseStarted to ResponseStartedAtCapture.
- Renders ForwardedIpChain as readable text instead of an array type name.
- These log-field changes require consumers of the previous field names to update their queries.
Previously added opt-in AllRaw request and response header capture for traffic diagnostics.
- Captures every header value, including unknown names and sensitive values, without framework redaction when enabled.
- Keeps the existing allowlisted, redacted behavior as the default.
- Preserves multiple values separately and respects the existing header field flags.