禁用.NET Core EF 2.0查询日志记录 [英] Disable .NET Core EF 2.0 Query Logging

查看:451
本文介绍了禁用.NET Core EF 2.0查询日志记录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当前.NET CORE EF 2.0将始终记录查询信息,是否可以禁用查询记录?

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

推荐答案

如果您仔细查看日志,将会看到 info标签。您可以在appSetings文件中编辑日志级别。您应该考虑将它们放置在生产环境以外的其他环境中,因为它们有时可能会有用。

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.

关于您所询问的内容,这是一个用于记录日志的appSetings.json的示例警告和更高级别。

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"
    }
}

这篇关于禁用.NET Core EF 2.0查询日志记录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆