Awesome
NLog.Extensions.Logging & NLog.Extensions.Hosting
<!--[![NuGet Pre Release](https://img.shields.io/nuget/vpre/NLog.Extensions.Logging.svg?label=NLog.Extensions.Logging)](https://www.nuget.org/packages/NLog.Extensions.Logging)--> <!--[![NuGet Pre Release](https://img.shields.io/nuget/vpre/NLog.Extensions.Hosting.svg?label=NLog.Extensions.Hosting)](https://www.nuget.org/packages/NLog.Extensions.Hosting)-->NLog.Extensions.Logging
NLog.Extensions.Logging enables NLog as Logging Provider for Microsoft ILogger-abstraction and Dependency Injection.
- Introduces
AddNLog()
extension methods to register NLog as LoggingProvider for Microsoft Extension Logging. - Introduces ${configsetting} for doing lookup of appsettings.json configuration settings.
- Adds support for loading NLog Configuration from appsettings.json
Notice the standard NLog NuGet package is enough for using NLog Logger with simple console application on the .NET Core platform.
Just add NLog.config
file to the project, and follow the tutorial for using GetCurrentClassLogger()
.
NLog.Extensions.Hosting
NLog.Extensions.Hosting only introduces UseNLog()
as extension-method for the IHostBuilder
.
Note if using ASP.NET Core then instead install NLog.Web.AspNetCore.