Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/NLog/NLog.Extensions.Logging
NLog as Logging Provider for Microsoft Extension Logging
https://github.com/NLog/NLog.Extensions.Logging
csharp dotnet logger logging logging-library net-core netcore netstandard nlog
Last synced: about 2 months ago
JSON representation
NLog as Logging Provider for Microsoft Extension Logging
- Host: GitHub
- URL: https://github.com/NLog/NLog.Extensions.Logging
- Owner: NLog
- License: bsd-2-clause
- Created: 2016-01-19T22:18:30.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2024-05-26T08:34:39.000Z (7 months ago)
- Last Synced: 2024-05-28T12:52:25.833Z (7 months ago)
- Topics: csharp, dotnet, logger, logging, logging-library, net-core, netcore, netstandard, nlog
- Language: C#
- Homepage: https://nlog-project.org
- Size: 1.58 MB
- Stars: 388
- Watchers: 23
- Forks: 153
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.MD
- License: LICENSE
Awesome Lists containing this project
- stars - NLog/NLog.Extensions.Logging
- awesome-dotnet-core - NLog.Extensions.Logging - 用于.NET标准库和.NET Core应用程序的Microsoft.Extensions.Logging的NLog提供程序 (框架, 库和工具 / 日志)
- fucking-awesome-dotnet-core - NLog.Extensions.Logging - NLog Provider for Microsoft.Extensions.Logging for .NET Standard libraries and .NET Core applications (Frameworks, Libraries and Tools / Logging)
- awesome-dotnet-core - NLog.Extensions.Logging - NLog Provider for Microsoft.Extensions.Logging for .NET Standard libraries and .NET Core applications (Frameworks, Libraries and Tools / Logging)
README
![NLog](https://nlog-project.org/images/NLog.png)
# NLog.Extensions.Logging & NLog.Extensions.Hosting
[![NuGet Release](https://img.shields.io/nuget/v/NLog.Extensions.Logging.svg?label=NLog.Extensions.Logging)](https://www.nuget.org/packages/NLog.Extensions.Logging)
[![NuGet Release](https://img.shields.io/nuget/v/NLog.Extensions.Hosting.svg?label=NLog.Extensions.Hosting)](https://www.nuget.org/packages/NLog.Extensions.Hosting)
[![Build status](https://ci.appveyor.com/api/projects/status/0nrg8cksp4b6tab1/branch/master?svg=true)](https://ci.appveyor.com/project/nlog/nlog-framework-logging/branch/master)
[![](https://sonarcloud.io/api/project_badges/measure?project=nlog.extensions.logging&branch=master&metric=ncloc)](https://sonarcloud.io/dashboard/?id=nlog.extensions.logging&branch=master)
[![](https://sonarcloud.io/api/project_badges/measure?project=nlog.extensions.logging&branch=master&metric=bugs)](https://sonarcloud.io/dashboard/?id=nlog.extensions.logging&branch=master)
[![](https://sonarcloud.io/api/project_badges/measure?project=nlog.extensions.logging&branch=master&metric=vulnerabilities)](https://sonarcloud.io/dashboard/?id=nlog.extensions.logging&branch=master)
[![](https://sonarcloud.io/api/project_badges/measure?project=nlog.extensions.logging&branch=master&metric=code_smells)](https://sonarcloud.io/project/issues?id=nlog.extensions.logging&branch=master&resolved=false&types=CODE_SMELL)
[![](https://sonarcloud.io/api/project_badges/measure?project=nlog.extensions.logging&branch=master&metric=duplicated_lines_density)](https://sonarcloud.io/component_measures/domain/Duplications?id=nlog.extensions.logging&branch=master)
[![](https://sonarcloud.io/api/project_badges/measure?project=nlog.extensions.logging&branch=master&metric=sqale_debt_ratio)](https://sonarcloud.io/dashboard/?id=nlog.extensions.logging&branch=master)
[![](https://sonarcloud.io/api/project_badges/measure?project=nlog.extensions.logging&branch=master&metric=coverage)](https://sonarcloud.io/component_measures?id=nlog.extensions.logging&branch=master&metric=coverage)## NLog.Extensions.Logging
[NLog.Extensions.Logging](https://www.nuget.org/packages/NLog.Extensions.Logging) enables NLog as Logging Provider for [Microsoft ILogger](https://github.com/NLog/NLog.Extensions.Logging/wiki/NLog-GetCurrentClassLogger-and-Microsoft-ILogger)-abstraction and Dependency Injection.
- Introduces `AddNLog()` extension methods to register NLog as LoggingProvider for Microsoft Extension Logging.
- Introduces [${configsetting}](https://github.com/NLog/NLog/wiki/ConfigSetting-Layout-Renderer) for doing lookup of appsettings.json configuration settings.
- Adds support for loading [NLog Configuration from appsettings.json](https://github.com/NLog/NLog.Extensions.Logging/wiki/NLog-configuration-with-appsettings.json)Notice the standard [NLog NuGet package](https://www.nuget.org/packages/NLog) 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](https://github.com/NLog/NLog/wiki/Tutorial#configure-nlog-targets-for-output) for using `GetCurrentClassLogger()`.## NLog.Extensions.Hosting
[NLog.Extensions.Hosting](https://www.nuget.org/packages/NLog.Extensions.Hosting) only introduces `UseNLog()` as extension-method for the `IHostBuilder`.
> Note if using **ASP.NET Core** then instead install [NLog.Web.AspNetCore](https://www.nuget.org/packages/NLog.web.aspnetcore).
### Getting Started Tutorials:
- [Getting started for ASP.NET Core 6](https://github.com/NLog/NLog/wiki/Getting-started-with-ASP.NET-Core-6)
- [Getting started for ASP.NET Core 5](https://github.com/NLog/NLog/wiki/Getting-started-with-ASP.NET-Core-5)
- [Getting started for ASP.NET Core 3.1](https://github.com/NLog/NLog/wiki/Getting-started-with-ASP.NET-Core-3)
- [Getting started for .NET Core Console application](https://github.com/NLog/NLog/wiki/Getting-started-with-.NET-Core-2---Console-application)
- [How to use structured logging](https://github.com/NLog/NLog/wiki/How-to-use-structured-logging)