Skip to main content
net10.0net11.0.NETFramework4.6.2net8.0.NETStandard2.0

Integrates NLog as provider for Microsoft.Extensions.Logging, and provides NLog LayoutRenderers to enrich logging output with details from HttpContext.

Published
Nov 10, 2026
12d ago
Total Downloads
189.6M
189,603,260

Install

dotnet add package NLog.Web.AspNetCore --version 6.3.0
ProductVersions
.NET
net10.0net11.0net8.0
.NET Standard
netstandard2.0
Other
.NETFramework4.6.2

README

NLog.Web.AspNetCore

NLog.Web.AspNetCore integrates NLog as a logging provider for Microsoft.Extensions.Logging by calling UseNLog() on the application HostBuilder.

Application code can continue using ILogger<T>, while NLog provides powerful logging capabilities including:

Supported platforms:

  • ASP.NET Core 8, 9, 10 and 11
  • ASP.NET Core 2, .NET Standard 2.0 and .NET 4.6.2+

Register NLog as logging provider:

builder.Logging.ClearProviders();
builder.Host.UseNLog();

If logging is needed before the host building, then one can use fluent setup:

var logger = NLog.LogManager.Setup().LoadConfigurationFromAppSettings().GetCurrentClassLogger();

Useful Links:

Changes from Previous Version

v6.2.2v6.3.0
Added Frameworks
net11.0
Removed Frameworks
net6.0
Added Dependencies
Removed Dependencies

Adoption Assessment

Teams already using NLog or requiring its configuration-oriented routing model.

Logging Guide
Compatibility metadata lists 5 target frameworks; confirm the exact target used by your application.
Editorial Note: NLog integration for ASP.NET Core with flexible target and rule configuration. Trade-off: Avoid adding a second logging pipeline when the existing provider already meets the requirement.

Related Guides & Workflows

Learn how to evaluate, integrate, or audit this package in your .NET project.