microsoft-extensions-logging

Microsoft.Extensions.Logging Vs. NLog

家住魔仙堡 提交于 2019-12-11 08:29:39
问题 I see a lot of posts mentioning usage of Microsoft.Extensions.Logging together with NLog. I'd like to better understand what Microsoft.Extensions.Logging is used for? And specifically why is it needed or what's the benefit of using it together with NLog? 回答1: With NLog you could do: var logger = NLog.LogManager.GetCurrentClassLogger(); logger.Info("Hello {Name}", "Earth"); That works for all platforms and all frameworks. Microsoft.Extensions.Logging With the introduction of .NET Core, a