Open-Awesome
CategoriesAlternativesStacksSelf-HostedExplore
Open-Awesome

© 2026 Open-Awesome. Curated for the developer elite.

TermsPrivacyAboutGitHubRSS
  1. Home
  2. Core
  3. NLog.Extensions.Logging

NLog.Extensions.Logging

BSD-2-ClauseC#v6.1.3

A logging provider that integrates NLog with Microsoft's ILogger abstraction and dependency injection for .NET applications.

Visit WebsiteGitHubGitHub
403 stars150 forks0 contributors

What is NLog.Extensions.Logging?

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.

Target Audience

.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.

Value Proposition

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.

Overview

NLog as Logging Provider for Microsoft Extension Logging

Use Cases

Best For

  • Integrating NLog into ASP.NET Core applications using dependency injection
  • Adding structured logging support to .NET applications via Microsoft ILogger
  • Configuring NLog through appsettings.json in .NET Core projects
  • Setting up logging for .NET Core console applications with HostBuilder
  • Capturing scope context properties in logs for better traceability
  • Using NLog as the logging provider in microservices built with .NET

Not Ideal For

  • Applications already committed to Serilog or other logging frameworks with similar ILogger integration
  • Projects prioritizing minimal dependencies and relying solely on Microsoft's built-in logging providers
  • Cross-platform development targeting non-.NET environments without Microsoft Extension Logging
  • Scenarios requiring quick, out-of-the-box logging with zero configuration overhead

Pros & Cons

Pros

Seamless ILogger Integration

Provides `AddNLog()` extension methods to register NLog as a logging provider for Microsoft Extension Logging, ensuring compatibility with .NET's standard logging abstraction.

Structured Logging Capture

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.

Flexible Configuration Options

Supports loading NLog configuration directly from appsettings.json and includes the `${configsetting}` layout renderer for easy appsettings integration, reducing manual setup.

HostBuilder Support

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.

Cons

ASP.NET Core Dependency Confusion

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.

NLog Knowledge Required

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.

Setup Overhead

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.

Frequently Asked Questions

Quick Stats

Stars403
Forks150
Contributors0
Open Issues2
Last commit4 days ago
CreatedSince 2016

Tags

#dependency-injection#csharp#logging-library#netstandard#dotnet#aspnet-core#logging#logger#structured-logging#console-application#netcore#nlog

Built With

N
NLog
.
.NET

Links & Resources

Website

Included in

Core21.2k
Auto-fetched 5 hours ago

Related Projects

SerilogSerilog

Simple .NET logging with fully-structured events

Stars7,959
Forks854
Last commit5 days ago
NLogNLog

NLog - Flexible and Structured Logging for various .NET Platforms

Stars6,537
Forks1,386
Last commit17 hours ago
serilog-aspnetcoreserilog-aspnetcore

Serilog integration for ASP.NET Core

Stars1,420
Forks212
Last commit5 months ago
log4netlog4net

Apache Log4net is a versatile, feature-rich, efficient logging API and backend for .NET

Stars927
Forks336
Last commit12 hours ago
Community-curated · Updated weekly · 100% open source

Found a gem we're missing?

Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.

Submit a projectStar on GitHub