DotNet.Memory.Logger 3.1.0

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

// Install DotNet.Memory.Logger as a Cake Tool
#tool nuget:?package=DotNet.Memory.Logger&version=3.1.0                

DotNet.Memory.Logger

.NET Memory Logger is a simple extension to log into memory by using ConcurrentQueue<T> collections

Version 3.1.0
  • Support SDK v.3.1.101-*
Version 2.1.2
  • Add support the feature turn on/off scope logging
  • Support SDK v.2.1.1

Adding DotNet.Memory.Logger

Add in the Web Host Builder configuring of Microsoft.Extensions.Logging.LoggerFactory the following initialization code:


     .ConfigureLogging((hostingContext, logging) =>
       {
           // ** Add DotNet.Memory.Logger
          logJsonCgf = hostingContext.Configuration.GetSection(nameof(MemoryLoggerSettings));
    
          if (!logJsonCgf.Exists())
          {
              throw new MissingMemberException($"Missing configuration section '{nameof(MemoryLoggerSettings)}'");
          }
    
          logging.AddMemoryLogger(logJsonCgf);
      }

Create NLogLoggerSettings configuration section in "appsettings.json".

The MemoryLoggerSettings section defines the Category Name "filter" and Category Name "mapper".

{
"MemoryLoggerSettings": {

    "IncludeScopes": true,

    "AcceptedCategoryNames": [ /* Filter of category name */
      "ConsoleInfo",   /* Exact category name is accepted */
      "CommonInfo",    /* Exact category name is accepted */
      "ConsoleError",  /* Exact category name is accepted */
      "FatalError",    /* Exact category name is accepted */
      "BusinessError", /* Exact category name is accepted */
      "*Error*",       /* The category name that contains "Error" is accepted */
      "*Info",         /* The category name that ends with "Info" is accepted */
      "Com*",          /* The category name that starts with "Com" is accepted */
      "*"              /* Any category name is accepted */
    ],

    "MemoryCacheSize":4096


  }
}
  • The AcceptedCategoryNames - "category name filter" is used to filter-in category names. It is expected that the category name is exact match to <logger name="...." in the NLog xml configuration.

Example project

See sample of pure memory + NLog logging style project Using Adaptation Nlog in .Net Core Rest Web Application

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  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. 
.NET Core netcoreapp3.1 is compatible. 
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
8.0.0 294 6/18/2024
7.0.0 2,758 11/10/2022
6.1.0 656 11/10/2022
6.0.0 1,076 8/3/2022
5.0.0 591 2/7/2021
3.1.0 1,209 2/15/2020
2.2.0 3,761 12/13/2018
2.1.2 828 9/4/2018
2.1.1 906 6/11/2018
2.1.0 865 6/4/2018
2.0.0 894 6/4/2018

Singed assembly; version for netstandard2.0