How can I log all queries to output when using DbContext
?
In the past I get all queries (SQLs) in Output window in Visual studio 2015. I don't know when this has stopped.
public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory, DbSeeder dbSeeder)
{
loggerFactory.AddConsole(Configuration.GetSection("Logging"));
loggerFactory.AddDebug();
And appsettings.json:
"Logging": {
"IncludeScopes": false,
"LogLevel": {
"Default": "Debug",
"System": "Information",
"Microsoft": "Information"
}
This is not working. And I think this means the logs should be in output.
Edited:
I think it is not possible without some work around. GitHub1, GitHub2.
For now I went with SQL Server Profiler.