Back to Aspnetcore

Sql Log

aspnetcore/includes/sql-log.md

latest713 B
Original Source

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.Development.json file:

[!code-json]

With the preceding JSON, SQL statements are displayed on the command line and in the Visual Studio output window.

For more information, see the following resources: