Disable .NET Core EF 2.0 Query Logging

这一生的挚爱 提交于 2019-12-13 03:45:34

问题


Current the .NET CORE EF 2.0 will always logging the Query info, is there a way to disable to query logging?


回答1:


If you look closely at the logs, you'll see the 'info' tag. You can edit the loglevel in your appSetings file. You should consider leaving them in others environment than production since they can be useful some times.

As for what you asked, here's an example of an appSetings.json used to log warnings and higher.

{
"Logging": {
    "IncludeScopes": false,
    "LogLevel": {
        "Default": "Warning"
    }
}


来源:https://stackoverflow.com/questions/47451291/disable-net-core-ef-2-0-query-logging

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