881 B
881 B
no-loc | ||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
SQL Logging of Entity Framework Core
Logging configuration is commonly provided by the Logging
section of appsettings.{Environment}
.json files. To log SQL statements, add "Microsoft.EntityFrameworkCore.Database.Command": "Information"
to the appsettings.json or appsettings.Development.json file:
With the preceding JSON, SQL statements are displayed on the command line and in the Visual Studio output window.
For more information, see Configure logging in ASP.NET Core and this GitHub issue.