Soenneker.Middlewares.TrafficLogging 4.0.493

Prefix Reserved
There is a newer version of this package available.
See the version list below for details.
dotnet add package Soenneker.Middlewares.TrafficLogging --version 4.0.493
                    
NuGet\Install-Package Soenneker.Middlewares.TrafficLogging -Version 4.0.493
                    
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="Soenneker.Middlewares.TrafficLogging" Version="4.0.493" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Soenneker.Middlewares.TrafficLogging" Version="4.0.493" />
                    
Directory.Packages.props
<PackageReference Include="Soenneker.Middlewares.TrafficLogging" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Soenneker.Middlewares.TrafficLogging --version 4.0.493
                    
#r "nuget: Soenneker.Middlewares.TrafficLogging, 4.0.493"
                    
#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.
#:package Soenneker.Middlewares.TrafficLogging@4.0.493
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Soenneker.Middlewares.TrafficLogging&version=4.0.493
                    
Install as a Cake Addin
#tool nuget:?package=Soenneker.Middlewares.TrafficLogging&version=4.0.493
                    
Install as a Cake Tool

Soenneker.Middlewares.TrafficLogging

alternate text is missing from this package README image alternate text is missing from this package README image alternate text is missing from this package README image alternate text is missing from this package README image

Adds structured ASP.NET Core request and response logging with sensitive payload capture disabled by default.

Installation

dotnet add package Soenneker.Middlewares.TrafficLogging

Registration

No service registration is required:

using Soenneker.Middlewares.TrafficLogging.Registrars;

app.UseTrafficLogging();
app.MapControllers();

Place it before endpoints and other middleware whose responses should be logged. WebSocket requests are passed through without traffic logging. If Information logging is disabled for Soenneker.Middlewares.TrafficLogging.TrafficLoggingMiddleware, the middleware adds no request or response capture.

Default output

The default log records method, scheme, host, path, response status, and known body length. It does not log query strings, headers, request bodies, or response bodies.

Enable additional fields individually through configuration:

{
  "TrafficLogging": {
    "LogHeaders": true,
    "LogQueryString": false,
    "LogRequestBody": false,
    "LogResponseBody": false
  }
}

Headers whose names indicate authorization, cookies, API keys, secrets, or tokens are always replaced with [REDACTED]. Header values are capped at 512 characters.

Text-like request and response bodies are captured only when their respective setting is enabled, and only the first 32 KiB is logged. Request body capture is skipped for GET, HEAD, DELETE, and TRACE, for declared empty bodies, for declared bodies over 5 MiB, and for non-text content types. Response capture forwards writes immediately and retains only the capped prefix, so it does not buffer the complete response or delay streaming output.

Security considerations

Opt-in data can still contain passwords, access tokens, personal information, and application-specific secret headers that a name-based redactor cannot identify. Query strings and JSON/form bodies are especially high risk. Enable them only in a controlled environment with appropriate log access, retention, and deletion policies.

Captured text is sanitized for control characters to prevent line-oriented log injection. Host names, paths, header values, and payload text remain attacker-controlled data and should not be used to construct log templates or security decisions.

Product Compatible and additional computed target framework versions.
.NET 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
4.0.534 120 10/15/2026
4.0.533 71 10/15/2026
4.0.532 61 10/15/2026
4.0.531 62 10/14/2026
4.0.530 63 10/14/2026
4.0.528 67 10/14/2026
4.0.527 63 10/14/2026
4.0.524 74 10/14/2026
4.0.516 83 10/13/2026
4.0.514 88 10/12/2026
4.0.512 86 10/12/2026
4.0.511 87 10/12/2026
4.0.508 96 10/11/2026
4.0.507 87 10/11/2026
4.0.506 206 9/30/2026
4.0.505 107 9/29/2026
4.0.504 97 9/25/2026
4.0.503 103 9/25/2026
4.0.502 101 9/24/2026
4.0.493 111 9/15/2026
Loading failed

Update dependency dotnet-sdk to v10.0.401 (#1028)