禁用.NET Core EF 2.0查询日志记录

编程入门 行业动态 更新时间:2024-10-26 04:27:55
本文介绍了禁用.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查询日志记录

本文发布于:2023-11-07 14:52:05,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1566749.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:日志   Core   NET   EF

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!