![]() |
VOOZH | about |
dotnet add package DMiddleware --version 9.0.0
NuGet\Install-Package DMiddleware -Version 9.0.0
<PackageReference Include="DMiddleware" Version="9.0.0" />
<PackageVersion Include="DMiddleware" Version="9.0.0" />Directory.Packages.props
<PackageReference Include="DMiddleware" />Project file
paket add DMiddleware --version 9.0.0
#r "nuget: DMiddleware, 9.0.0"
#:package DMiddleware@9.0.0
#addin nuget:?package=DMiddleware&version=9.0.0Install as a Cake Addin
#tool nuget:?package=DMiddleware&version=9.0.0Install as a Cake Tool
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0">
</head> <body>
<h1>Request Logging Middleware</h1>
<p>The <strong>Request Logging Middleware</strong> is a custom ASP.NET Core middleware designed to log detailed information about incoming HTTP requests and their corresponding responses. It provides functionality to capture various metrics, including CPU and memory usage, response times, and request details, enhancing monitoring and troubleshooting capabilities in your application.</p>
<h2>Key Features</h2> <ul> <li><strong>Request and Response Logging</strong>: Logs the HTTP method, path, timestamp, and response status, along with request and response bodies (configurable).</li> <li><strong>Performance Metrics</strong>: Tracks CPU usage, memory consumption, and request duration for each processed request.</li> <li><strong>Error Handling</strong>: Captures and logs detailed error information if exceptions occur during request processing.</li> <li><strong>Configurable Options</strong>: Easily configurable options to choose what data to log (request body, headers, response, etc.).</li> <li><strong>Database Integration</strong>: Utilizes a database context to persist log entries for further analysis.</li> </ul>
<h2>Usage</h2> <h3>appSettings.json</h3> <p>insert the following configuration into <code>appSettings.json</code> file:</p> <pre><code>{ "HTTPLogConnection": { "DatabaseProvider": "", // SQL or PostgreSQL, the default is SQL "DefaultConnection": "" } }</code></pre>
<p>To use this middleware, configure it in your ASP.NET Core application’s startup/program.cs:</p>
<pre><code>services.ConfigureDMiddlewareServices(options => { options.SaveRequestBody = true; options.SaveRequesterInfo = true; options.SaveRequestHeader = true; options.SaveResponse = true; options.LogTheLoggDashboard = false; });</code></pre>
<p>Then add the middleware to the request pipeline:</p>
<pre><code>app.UseRequestLogging();</code></pre>
<h4>Accessing the Logs Dashboard</h4>
<p> To access the logs dashboard, you can map the dashboard route by adding the following to your Configure method in Startup.cs or Program.cs:</p>
<pre><code>app.MapDLoggerDashboard();</code></pre> <p>Once the dashboard is configured, you can access it via the following URL:</p> <pre><code>yourURL/DLogger/index.html</code></pre>
<p>This middleware helps developers monitor application behavior and diagnose issues effectively, making it an essential tool for robust application logging.</p>
</body> </html>
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net9.0 net9.0 is compatible. net9.0-android net9.0-android was computed. net9.0-browser net9.0-browser was computed. net9.0-ios net9.0-ios was computed. net9.0-maccatalyst net9.0-maccatalyst was computed. net9.0-macos net9.0-macos was computed. net9.0-tvos net9.0-tvos was computed. net9.0-windows net9.0-windows was computed. net10.0 net10.0 was computed. net10.0-android net10.0-android was computed. net10.0-browser net10.0-browser was computed. net10.0-ios net10.0-ios was computed. net10.0-maccatalyst net10.0-maccatalyst was computed. net10.0-macos net10.0-macos was computed. net10.0-tvos net10.0-tvos was computed. net10.0-windows net10.0-windows was computed. |
This package is not used by any NuGet packages.
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 9.0.0 | 213 | 12/26/2024 |
| 8.1.0 | 201 | 1/30/2025 |
| 8.0.0 | 189 | 12/26/2024 |
| 7.1.0 | 181 | 1/30/2025 |
| 7.0.0 | 178 | 12/26/2024 |
| 6.1.0 | 215 | 1/30/2025 |
| 6.0.0 | 188 | 12/26/2024 |
| 5.5.3 | 373 | 1/31/2025 |
| 5.5.2 | 184 | 1/31/2025 |
| 5.5.1 | 205 | 1/30/2025 |
| 5.5.0 | 218 | 11/21/2024 |
| 5.4.0 | 203 | 11/21/2024 |
| 5.3.0 | 198 | 11/15/2024 |
| 5.2.0 | 186 | 10/27/2024 |
| 5.1.3 | 183 | 10/26/2024 |
| 5.1.1 | 188 | 10/26/2024 |
| 5.1.0 | 176 | 10/26/2024 |
| 5.0.0 | 184 | 10/26/2024 |
| 2.1.0 | 188 | 10/22/2024 |
| 2.0.0 | 189 | 10/22/2024 |