问题
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