Tolitech.Logging.Extensions
1.0.0-preview.2
dotnet add package Tolitech.Logging.Extensions --version 1.0.0-preview.2
NuGet\Install-Package Tolitech.Logging.Extensions -Version 1.0.0-preview.2
<PackageReference Include="Tolitech.Logging.Extensions" Version="1.0.0-preview.2" />
<PackageVersion Include="Tolitech.Logging.Extensions" Version="1.0.0-preview.2" />
<PackageReference Include="Tolitech.Logging.Extensions" />
paket add Tolitech.Logging.Extensions --version 1.0.0-preview.2
#r "nuget: Tolitech.Logging.Extensions, 1.0.0-preview.2"
#addin nuget:?package=Tolitech.Logging.Extensions&version=1.0.0-preview.2&prerelease
#tool nuget:?package=Tolitech.Logging.Extensions&version=1.0.0-preview.2&prerelease
Tolitech.Logging.Extensions
The Tolitech.Logging.Extensions library enhances logging capabilities in .NET applications using Microsoft.Extensions.Logging. It includes predefined logger message definitions for standardized logging practices across applications.
Features
- LoggerMessageDefinitions: Provides a centralized location for defining logger messages using Microsoft's LoggerMessage attribute.
- This allows for consistent logging practices and reduces redundancy in log message definitions.
Usage
LoggerMessageDefinitions
The LoggerMessageDefinitions class simplifies the definition of logger messages using Microsoft.Extensions.Logging. Here's an example of how to use it:
using Microsoft.Extensions.Logging;
namespace YourNamespace
{
public static class LoggerMessageDefinitions
{
[LoggerMessage(
EventId = 0,
EventName = "UnexpectedError",
Level = LogLevel.Error,
Message = "An unexpected error occurred.",
SkipEnabledCheck = true)]
public static partial void UnexpectedError(ILogger logger, Exception exception);
}
}
Logging Configuration
Ensure your logging configuration (appsettings.json or equivalent) is set up to include Tolitech.Logging.Extensions for optimal logging performance and functionality.
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net9.0 is compatible. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net9.0
- Microsoft.Extensions.Logging (>= 9.0.6)
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 |
---|---|---|
1.0.0-preview.2 | 95 | 7/2/2025 |
1.0.0-preview.1 | 91 | 12/7/2024 |