![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 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 Release](https://img.shields.io/nuget/v/NLog.Extensions.Hosting.svg?label=NLog.Extensions.Hosting)](https://www.nuget.org/packages/NLog.Extensions.Hosting)
<!--[![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)-->
[![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) makes it possible to use NLog together with [Microsoft ILogger](https://github.com/NLog/NLog.Extensions.Logging/wiki/NLog-GetCurrentClassLogger-and-Microsoft-ILogger)-abstraction and Dependency Injection.
It provides extension methods to register NLog as LoggingProvider for Microsoft Extension Logging using `AddNLog()` or `UseNLog()`.
> Note if using **ASP.NET Core** then instead install [NLog.Web.AspNetCore](https://www.nuget.org/packages/NLog.web.aspnetcore).
[NLog.Extensions.Logging](https://www.nuget.org/packages/NLog.Extensions.Logging) also makes it possible to load [NLog Configurations 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()`.
### 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)
没有合适的资源?快使用搜索试试~ 我知道了~
NLog作为Microsoft扩展日志记录的日志记录提供程序-C#-PowerShell-下载
共74个文件
cs:43个
csproj:7个
yml:5个
1.该资源内容由用户上传,如若侵权请联系客服进行举报
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
版权申诉
0 下载量 70 浏览量
2023-03-15
20:00:16
上传
评论
收藏 95KB ZIP 举报
温馨提示
(更多详情、使用方法,请下载后细读README.md文件) 'NLog.Extensions.Logging & NLog.Extensions.Hosting NLog.Extensions.Logging NLog.Extensions.Logging使得将 NLog 与Microsoft ILogger抽象和依赖注入一起使用成为可能。AddNLog()它提供扩展方法以使用或将 NLog 注册为 Microsoft 扩展日志记录的 LoggingProvider UseNLog()。 请注意,如果使用ASP.NET Core,则改为安装NLog.Web.AspNetCore。 NLog.Extensions.Logging还可以从 appsettings.json 加载 NLog 配置 请注意,标准NLog NuGet 包足以在 .NET Core 平台上将 NLog Logger 与简单的控制台应用程序一起使用。只需将NLog.config文件添加到项目中,然后按照教程使用GetCurrentClassLogger(). 入门教程: ASP.NET Core 6 入门 ASP.N
资源推荐
资源详情
资源评论
收起资源包目录
NLog作为Microsoft扩展日志记录的日志记录提供程序.zip (74个子文件)
NLog.Extensions.Logging-master
CHANGELOG.MD 26KB
run-sonar.ps1 2KB
NLog.Extensions.Logging.sln 5KB
.github
dependabot.yml 683B
release-drafter.yml 896B
ranger.yml 464B
ISSUE_TEMPLATE.md 1KB
workflows
changelog.yml 395B
.gitattributes 482B
src
NLog.snk 596B
NLog.Extensions.Logging
NLog.Extensions.Logging.csproj.DotSettings 1KB
Internal
StringExtensions.cs 299B
RegisterNLogLoggingProvider.cs 5KB
Guard.cs 2KB
Layouts
MicrosoftConsoleJsonLayout.cs 10KB
Logging
NLogLoggerProvider.cs 4KB
NLogLogger.cs 21KB
NLogBeginScopeParser.cs 11KB
EventIdCaptureType.cs 1KB
ActivityExtensions.cs 1KB
NLogLoggerFactory.cs 3KB
NLogProviderOptions.cs 5KB
NLogMessageParameterList.cs 10KB
LayoutRenderers
ConfigSettingLayoutRenderer.cs 4KB
MicrosoftConsoleLayoutRenderer.cs 4KB
Properties
AssemblyInfo.cs 507B
Targets
MicrosoftILoggerTarget.cs 10KB
Config
NLogLoggingConfiguration.cs 16KB
SetupExtensionsBuilderExtensions.cs 1KB
SetupBuilderExtensions.cs 1KB
Extensions
ConfigureExtensions.cs 13KB
NLog.Extensions.Logging.csproj 6KB
ILLink.Descriptors.xml 129B
NLog.Extensions.Hosting
NLog.Extensions.Hosting.csproj 3KB
Properties
AssemblyInfo.cs 507B
Extensions
ConfigureExtensions.cs 5KB
ILLink.Descriptors.xml 194B
LICENSE 1KB
examples
NetCore2
HostingExample
HostingExample.csproj 700B
Program.cs 3KB
nlog.config 1KB
ConsoleExampleJsonConfig
ConsoleExampleJsonConfig.csproj 804B
Program.cs 3KB
appsettings.json 2KB
ConsoleExample
Program.cs 2KB
ConsoleExample.csproj 799B
nlog.config 1KB
NLog.Extensions.Logging.sln.DotSettings 688B
test
NLog.Extensions.Hosting.Tests
Properties
AssemblyInfo.cs 152B
ExtensionMethodTests.cs 5KB
NLog.Extensions.Hosting.Tests.csproj 2KB
NLog.Extensions.Logging.Tests
LoggerTests.cs 20KB
ConfigSettingLayoutRendererTests.cs 2KB
MicrosoftConsoleJsonLayoutTests.cs 3KB
NLogMessageParameterListTests.cs 3KB
Logging
NLogLoggerProviderTests.cs 1KB
NLogMessageParameterListTests.cs 5KB
NLogLoggerFactoryTests.cs 3KB
NLogTestBase.cs 3KB
Properties
AssemblyInfo.cs 541B
CustomLoggerCallSiteTest.cs 2KB
NLog.Extensions.Logging.Tests.csproj 2KB
MicrosoftILoggerTargetTests.cs 12KB
CustomBeginScopeTest.cs 6KB
CustomLoggerPropertyTest.cs 5KB
Extensions
ConfigureExtensionsTests.cs 9KB
NLogLoggingConfigurationTests.cs 18KB
MicrosoftConsoleLayoutRendererTest.cs 2KB
nlog.config 610B
run-tests.ps1 882B
.gitignore 4KB
appveyor.yml 3KB
README.md 4KB
build.ps1 2KB
共 74 条
- 1
资源评论
快撑死的鱼
- 粉丝: 1w+
- 资源: 9156
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功