How to setup event log for .NET Core 3.0 Worker Service

限于喜欢 提交于 2019-12-05 10:22:24

So I was able to find the issue reported here.

Essentially it boils down to a change in the latest .NET Core 3.0 Preview where Event Logs are filtered at the warning level by default now. Thus, you cannot see any information logs.

The fix was to simply edit the appsettings.json file to look like the following:

{
  "Logging": {
    "LogLevel": {
      "Default": "Information",
      "Microsoft": "Warning",
      "Microsoft.Hosting.Lifetime": "Information"
    },
    "EventLog": {
      "LogLevel": {
        "Default": "Information",
        "Microsoft.Hosting.Lifetime": "Information"
      }
    }
  }
}

This overrides the default set and allows information logs to be viewed again.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!