Entity Framework Profiler (EFProfiler) is a tool for finding slow queries
To install EFProfiler, run the following command in Package Manager Console
pm> Install-Package EFProfiler
You can also view the package page on NuGet.
You should add this configuration in appsetting.js file :
"EFProfilerSetting": {
"MaxMillisecond": 100,
"Path": "wwwroot\\LogFile\\",
"ActiveLog": true,
"EFProfilerUIOptions": {
"RoutePrefix": "efprofiler",
"DocumentTitle": "EFProfiler UI",
"HeadContent": "EFProfiler",
"Authorization": {
"Roles": "admin",
"Users": ""
}
}
}
Add required services Startup class as below :
services.AddDbContext(options =>
{
options.UseSqlServer(_configuration.GetConnectionString("DataContext"));
options.AddInterceptors(_configuration);
});
To display the logs :
app.EFProfilerUI(_configuration);
Configuring Dashboard authorization :
app.UseAuthentication();
app.UseAuthorization();
app.EFProfilerUI(_configuration);
Then enter the following address in the browser :
https://{sitename}/efprofiler/index.html