# NLog.Extensions.Logging
[![](https://sonarcloud.io/api/project_badges/measure?project=nlog.extensions.logging&branch=master&metric=reliability_rating)](https://sonarcloud.io/dashboard/?id=nlog.extensions.logging&branch=master)
[![](https://sonarcloud.io/api/project_badges/measure?project=nlog.extensions.logging&branch=master&metric=sqale_rating)](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)
Integrates NLog as Logging provider for Microsoft.Extensions.Logging, by just calling `AddNLog()` on the Logging-builder.
Providing features like:
- Capture [structured message properties](https://github.com/NLog/NLog.Extensions.Logging/wiki/NLog-properties-with-Microsoft-Extension-Logging) from the [Microsoft ILogger](https://github.com/NLog/NLog.Extensions.Logging/wiki/NLog-GetCurrentClassLogger-and-Microsoft-ILogger)
- Capture scope context properties from the Microsoft ILogger `BeginScope`
- Load NLog configuration from [appsettings.json](https://github.com/NLog/NLog.Extensions.Logging/wiki/NLog-configuration-with-appsettings.json)
- Routing logging output to multiple destinations via the available [NLog Targets](https://nlog-project.org/config/?tab=targets)
- Enrich logging output with additional context details via the available [NLog LayoutRenderers](https://nlog-project.org/config/?tab=layout-renderers)
- Rendering logging output into standard formats like JSON, CVS, W3C ELF and XML using [NLog Layouts](https://nlog-project.org/config/?tab=layouts).
If using ASP.NET Core then check [NLog.Web.AspNetCore](https://www.nuget.org/packages/NLog.Web.AspNetCore).
Supported platforms:
- .NET 5, 6 and 7
- .NET Core 1, 2 and 3
- .NET Standard 1.3+ and 2.0+
- .NET 4.6.1 - 4.8
Registration of NLog as logging provider:
```csharp
builder.Logging.ClearProviders();
builder.Logging.AddNLog();
```
Useful Links
- [Home Page](https://nlog-project.org/)
- [Change Log](https://github.com/NLog/NLog.Extensions.Logging/releases)
- [Tutorial](https://github.com/NLog/NLog/wiki/Tutorial)
- [Logging Troubleshooting](https://github.com/NLog/NLog/wiki/Logging-troubleshooting)
- [Have a question?](https://stackoverflow.com/questions/tagged/nlog)
没有合适的资源?快使用搜索试试~ 我知道了~
C# 使用NLog记录日志
共273个文件
xml:55个
dll:55个
_:34个
1 下载量 74 浏览量
2023-11-06
08:50:46
上传
评论
收藏 8.13MB RAR 举报
温馨提示
C# 使用NLog记录日志
资源推荐
资源详情
资源评论
收起资源包目录
C# 使用NLog记录日志 (273个子文件)
_._ 0B
_._ 0B
_._ 0B
_._ 0B
_._ 0B
_._ 0B
_._ 0B
_._ 0B
_._ 0B
_._ 0B
_._ 0B
_._ 0B
_._ 0B
_._ 0B
_._ 0B
_._ 0B
_._ 0B
_._ 0B
_._ 0B
_._ 0B
_._ 0B
_._ 0B
_._ 0B
_._ 0B
_._ 0B
_._ 0B
_._ 0B
_._ 0B
_._ 0B
_._ 0B
_._ 0B
_._ 0B
_._ 0B
_._ 0B
MainWindow.baml 1KB
DesignTimeResolveAssemblyReferencesInput.cache 22KB
WpfApp1.csproj.AssemblyReference.cache 22KB
DesignTimeResolveAssemblyReferencesInput.cache 7KB
ConsoleApp1.csproj.AssemblyReference.cache 6KB
WpfApp1_MarkupCompile.cache 221B
WpfApp1_MarkupCompile.i.cache 220B
DesignTimeResolveAssemblyReferences.cache 203B
WpfApp1.csproj.GenerateResource.cache 84B
WpfApp1.csproj.CoreCompileInputs.cache 42B
ConsoleApp1.csproj.CoreCompileInputs.cache 42B
WpfApp1.csproj.SuggestedBindingRedirects.cache 0B
ConsoleApp1.csproj.SuggestedBindingRedirects.cache 0B
packages.config 1KB
NLog.config 1KB
NLog.config 1KB
NLog.config 1KB
NLog.config 1KB
App.config 187B
WpfApp1.exe.config 187B
App.config 187B
ConsoleApp1.exe.config 187B
packages.config 131B
WpfApp1.csproj.CopyComplete 0B
ConsoleApp1.csproj.CopyComplete 0B
MainWindow.g.cs 4KB
MainWindow.g.i.cs 4KB
Resources.Designer.cs 3KB
App.g.i.cs 2KB
App.g.cs 2KB
AssemblyInfo.cs 2KB
Program.cs 2KB
AssemblyInfo.cs 1KB
Settings.Designer.cs 1KB
MainWindow.xaml.cs 1KB
WpfApp1_Content.g.i.cs 523B
WpfApp1_Content.g.cs 523B
App.xaml.cs 334B
.NETFramework,Version=v4.8.AssemblyAttributes.cs 210B
.NETFramework,Version=v4.8.AssemblyAttributes.cs 210B
WpfApp1.csproj 9KB
ConsoleApp1.csproj 3KB
NLog.dll 922KB
NLog.dll 922KB
NLog.dll 922KB
NLog.dll 919KB
NLog.dll 908KB
NLog.dll 890KB
NLog.dll 879KB
NLog.dll 832KB
System.Numerics.Vectors.dll 160KB
System.Numerics.Vectors.dll 157KB
System.Numerics.Vectors.dll 157KB
System.Memory.dll 145KB
System.Memory.dll 145KB
System.Memory.dll 141KB
System.Numerics.Vectors.dll 113KB
System.Numerics.Vectors.dll 113KB
NLog.Extensions.Logging.dll 62KB
NLog.Extensions.Logging.dll 60KB
NLog.Extensions.Logging.dll 60KB
NLog.Extensions.Logging.dll 60KB
NLog.Extensions.Logging.dll 60KB
NLog.Extensions.Logging.dll 57KB
NLog.Extensions.Logging.dll 57KB
Microsoft.Extensions.Logging.Abstractions.dll 46KB
共 273 条
- 1
- 2
- 3
资源评论
weixin_42365213
- 粉丝: 57
- 资源: 24
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功