AJProds.MessageLoggerProvider 6.0.0

dotnet add package AJProds.MessageLoggerProvider --version 6.0.0
NuGet\Install-Package AJProds.MessageLoggerProvider -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" 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 --version 6.0.0
#r "nuget: AJProds.MessageLoggerProvider, 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 as a Cake Addin
#addin nuget:?package=AJProds.MessageLoggerProvider&version=6.0.0

// Install AJProds.MessageLoggerProvider as a Cake Tool
#tool nuget:?package=AJProds.MessageLoggerProvider&version=6.0.0

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

  1. Setup
    • Add the Microsoft.Extensions.Logging package to your project.
    • Set up your Logger configuration. For examples see the Best practices below.
    • Initialize this package in your application (either in the root or per request) via the IMessagesAccessor.Init(). Behind the scenes, this project uses AsyncLocal.
  2. Add messages via the ILogger injected, or via its extensions.
  3. Process, transform (, or add more messages) via the IMessagesAccessor

+1. See the ConsoleAPp 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 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.

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
6.0.0 188 12/28/2023
1.0.0 163 3/15/2023