asp.net - ILoggingBuilder 没有参数为 0 的 AddEventSourceLogger。如何初始化此日志记录

标签 asp.net asp.net-core logging azure-web-app-service

“ILoggingBuilder”不包含“AddEventSourceLogger”的定义,并且找不到接受“ILoggingBuilder”类型的第一个参数的可访问扩展方法“AddEventSourceLogger”

    Microsoft.AspNetCore.WebHost.CreateDefaultBuilder(args)
            .ConfigureLogging(logging =>
        {
            // Requires `using Microsoft.Extensions.Logging;`
            // logging.AddConfiguration(hostingContext.Configuration.GetSection("Logging"));
            logging.AddConsole();
            logging.AddDebug();
            logging.AddEventSourceLogger();
        })
        .UseApplicationInsights()
        .UseStartup<StartupConsole>()
        .UseDefaultServiceProvider(options => options.ValidateScopes = false);

我目前正在使用 .net-core 2.1 并安装了用于使用 Microsoft.Extensions.Logging 的 nuget。

最佳答案

关于asp.net - ILoggingBuilder 没有参数为 0 的 AddEventSourceLogger。如何初始化此日志记录,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58817192/

相关文章:

c# - 模块化单体中的跨模块通信

c# - Database.SqlQuery 和 EF 6.1 之间的性能有什么区别吗?

javascript - Leaflet.js 从 AJAX 添加层

c# - 将代码从 Java 转换为 C#/ASP.NET

c# - Vue 在 axios post 请求中的对象中发送空参数

.net - 不在本地主机上时 SignalR 连接失败

javascript - 记录javascript错误

linux - 用于为日志文件中的每个条目添加耗时的命令行脚本或实用程序?

node.js - 不小心删除了nodejs.log,现在Openshift不记录任何内容。

c# - 如何使用 ffmpeg 为所有视频文件生成缩略图?