ASP.NET Core 入门教程 10、ASP.NET Core 日志记录(NLog)入门


一、前言

https://github.com/ken-io/asp.net-core-tutorial/tree/master/chapter-02

日志级别为Information AddConsole() 添加日志提供程序->控制台

这里设置项,主要是SetMinimumLevel(LogLevel.Information),我们把日志级别设置为Information,可以减少很多控制台日志输出

https://github.com/ken-io/asp.net-core-tutorial/tree/master/chapter-10

  • 本文参考

https://docs.microsoft.com/zh-cn/aspnet/core/fundamentals/logging/?view=aspnetcore-2.1

https://github.com/NLog/NLog.Web/wiki/Getting-started-with-ASP.NET-Core-2

https://github.com/nlog/NLog/wiki


b恩文首发于我的独立博客:https://ken.io/note/asp.net-core-tutorial-log-nlog