How to find and log slow queries in Entity Framework using the interceptor system

In Entity Framework Core we can log slow running queries using the interceptor system. This is easy and involves two main steps…

Create an interceptor class which inherits from DbCommandInterceptor and implement the ReaderExecuted method.

and

Register the interceptor class from the ConfigureServices method in Startup.cs

Leave a Reply

Your email address will not be published. Required fields are marked *