NLog.Extensions.Logging
Integrates NLog as Logging provider for Microsoft.Extensions.Logging, by just calling AddNLog() on the Logging-builder.
Providing features like:
- Capture structured message properties from the Microsoft ILogger
- Capture scope context properties from the Microsoft ILogger
BeginScope - Load NLog configuration from appsettings.json
- Routing logging output to multiple destinations via the available NLog Targets
- Enrich logging output with additional context details via the available NLog LayoutRenderers
- Rendering logging output into standard formats like JSON, CVS, W3C ELF and XML using NLog Layouts.
If using ASP.NET Core then check NLog.Web.AspNetCore.
Supported platforms:
- .NET 6, 7, 8, 9 and 10
- .NET Standard 2.0 and 2.1
- .NET 4.6.2 - 4.8
Register NLog as logging provider:
builder.Logging.ClearProviders();
builder.Logging.AddNLog();
Useful Links: