DMiddleware 5.4.0

There is a newer version of this package available.
See the version list below for details.
dotnet add package DMiddleware --version 5.4.0                
NuGet\Install-Package DMiddleware -Version 5.4.0                
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="DMiddleware" Version="5.4.0" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add DMiddleware --version 5.4.0                
#r "nuget: DMiddleware, 5.4.0"                
#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 DMiddleware as a Cake Addin
#addin nuget:?package=DMiddleware&version=5.4.0

// Install DMiddleware as a Cake Tool
#tool nuget:?package=DMiddleware&version=5.4.0                

<!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 Compatible and additional computed target framework versions.
.NET net5.0 is compatible.  net5.0-windows was computed.  net6.0 was computed.  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-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. 
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
5.5.0 39 11/21/2024
5.4.0 37 11/21/2024
5.3.0 79 11/15/2024
5.2.0 85 10/27/2024
5.1.3 77 10/26/2024
5.1.1 70 10/26/2024
5.1.0 66 10/26/2024
5.0.0 73 10/26/2024
2.1.0 84 10/22/2024
2.0.0 77 10/22/2024
1.0.0 104 10/20/2024