Disable .NET Core EF 2.0 Query Logging

2019-08-27 12:02发布

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

1条回答
唯我独甜
2楼-- · 2019-08-27 12:43

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"
    }
}
查看更多
登录 后发表回答