DotNet.Memory.Logger
3.1.0
Dot Net Memory logger for Microsoft.Extensions.Logging.
Install-Package DotNet.Memory.Logger -Version 3.1.0
dotnet add package DotNet.Memory.Logger --version 3.1.0
<PackageReference Include="DotNet.Memory.Logger" Version="3.1.0" />
paket add 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
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
Release Notes
Singed assembly; version for netstandard2.0
Dependencies
-
.NETCoreApp 3.1
- Microsoft.Extensions.Configuration (>= 3.1.1)
- Microsoft.Extensions.Configuration.Binder (>= 3.1.1)
- Microsoft.Extensions.Logging (>= 3.1.1)
Used By
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.