A logging provider that integrates NLog with Microsoft's ILogger abstraction and dependency injection for .NET applications.
NLog.Extensions.Logging is a library that integrates the NLog logging framework with Microsoft's ILogger abstraction and dependency injection system. It allows developers to use NLog as their logging provider within .NET applications that leverage Microsoft Extension Logging, providing a unified logging interface. This solves the problem of bridging custom logging frameworks with standardized .NET logging patterns.
.NET developers building applications with ASP.NET Core or .NET Core console apps who want to use NLog for logging while adhering to Microsoft's ILogger standards.
Developers choose this library because it seamlessly combines NLog's powerful, flexible logging capabilities with the convenience and standardization of Microsoft's logging abstractions, reducing configuration complexity and ensuring consistency across projects.
NLog as Logging Provider for Microsoft Extension Logging
Provides `AddNLog()` extension methods to register NLog as a logging provider for Microsoft Extension Logging, ensuring compatibility with .NET's standard logging abstraction.
Captures structured message properties and scope context from ILogger, enabling richer log data for analysis and monitoring, as detailed in the README's structured logging support.
Supports loading NLog configuration directly from appsettings.json and includes the `${configsetting}` layout renderer for easy appsettings integration, reducing manual setup.
Offers `UseNLog()` for HostBuilder integration with layout renderers like `${host-environment}`, making it suitable for .NET Core console applications, as highlighted in the hosting extensions.
The README explicitly notes that for ASP.NET Core, a separate package NLog.Web.AspNetCore is recommended, adding an extra dependency and potential setup complexity.
Developers must understand NLog's own configuration and features, which can be overwhelming for those new to advanced logging frameworks, beyond the basic ILogger integration.
Compared to Microsoft's built-in logging providers, integrating NLog requires additional configuration steps and familiarity with both NLog and Microsoft logging systems, increasing initial effort.
Simple .NET logging with fully-structured events
NLog - Flexible and Structured Logging for various .NET Platforms
Serilog integration for ASP.NET Core
Apache Log4net is a versatile, feature-rich, efficient logging API and backend for .NET
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.