zl程序教程

您现在的位置是:首页 >  后端

当前栏目

使用 .NET Core 的日志记录

NetCore日志 记录 使用
2023-09-14 08:57:07 时间

如何使用 Microsoft.Extensions.Logging

 

public static void Main(string[] args = null) { 

ILoggerFactory loggerFactory = new LoggerFactory().AddConsole().AddDebug();  

ILogger logger = loggerFactory.CreateLogger<Program>();  

logger.LogInformation(     "This is a test of the emergency broadcast system."); }

详细参考:https://msdn.microsoft.com/magazine/mt694089