In .Net framework I use MiniProfiler for MySql connection command logging. In my current AspNetCore solution MiniProfiler doesn't show sql commands as well. What MiniProfiler options I should be using to log it?
Asked
Active
Viewed 287 times
2 Answers
1
Thanks, It is not for Entity Framework, but solution is using MiniProfiler to profile MySQL Server. And the connection is wrap as following:
public DbConnection GetConnection()
{
DbConnection connection = new System.Data.SqlClient.SqlConnection("...");
return new StackExchange.Profiling.Data.ProfiledDbConnection(connection, MiniProfiler.Current);
}
But this does not help, as it does not capture actual SQL command with the parameter list. Please suggest if any additional options need to be configured.

usvd
- 31
- 2
0
If you're using Entity Framework Core, you need to:
- Install the MiniProfiler.EntityFrameworkCore NuGet package.
- In your
Startup.cs
, callAddEntityFramework()
:
public void ConfigureServices(IServiceCollection services)
{
services.AddMiniProfiler()
.AddEntityFramework();
}
Source: MiniProfiler documentation

Métoule
- 13,062
- 2
- 56
- 84
-
1I don't use EntityFramework. I need to log sql commands for MySqlConnection + Dapper – Valery Yegorov Jan 24 '20 at 18:36