AJProds.MessageLoggerProvider.HttpContext
6.0.0
dotnet add package AJProds.MessageLoggerProvider.HttpContext --version 6.0.0
NuGet\Install-Package AJProds.MessageLoggerProvider.HttpContext -Version 6.0.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="AJProds.MessageLoggerProvider.HttpContext" Version="6.0.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add AJProds.MessageLoggerProvider.HttpContext --version 6.0.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: AJProds.MessageLoggerProvider.HttpContext, 6.0.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 AJProds.MessageLoggerProvider.HttpContext as a Cake Addin #addin nuget:?package=AJProds.MessageLoggerProvider.HttpContext&version=6.0.0 // Install AJProds.MessageLoggerProvider.HttpContext as a Cake Tool #tool nuget:?package=AJProds.MessageLoggerProvider.HttpContext&version=6.0.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
Purpose
This simple project is intended to provide the opportunity for storing and reading specific messages logged via the Microsoft.Extensions.Logging
.
These messages should be useful only for the consumer of your project, therefore exceptions, stack-traces, or any other sensitive data
should not be logged via this Logging Provider.
How to use
- Setup
- Set up your Logger configuration. For examples see the Best practices below.
- Register the Logging Provider as shown here:
builder.Logging .ClearProviders() .AddMessageLoggerProvider();
- Initialize the
BaseMessageHolder
per request via theapp.UseMessageLoggerProvider();
middleware.
- Add messages via the
ILogger
injected, or via its extensions. - Process, transform (, or add more messages) via the
IMessagesAccessor
+1. See the WebApp in the Test folder for ideas!
Best practices
- Always set the Logging Configuration, because you can easily get OutOfMemoryException!
{ "Logging": { "MessageLoggerProvider": { "LogLevel": { "Default": "Information", "My.Awesome.BusinessCore.Project": "Warning" } } } }
- Verify the messages gathered, before you send them back to the consumer. These messages shall not contain sensitive content!
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | 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 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.
-
net6.0
- AJProds.MessageLoggerProvider.Core (>= 6.0.0)
- Microsoft.AspNetCore.Http (>= 2.2.0)
- Microsoft.Extensions.Logging (>= 6.0.0)
- Microsoft.Extensions.Logging.Abstractions (>= 6.0.3)
- Microsoft.Extensions.Options (>= 6.0.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.