Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Logging Not Working for ExecuteStoredProcedureAsync #55

Open
rwoodslap opened this issue Nov 15, 2024 · 4 comments
Open

Logging Not Working for ExecuteStoredProcedureAsync #55

rwoodslap opened this issue Nov 15, 2024 · 4 comments
Assignees

Comments

@rwoodslap
Copy link

I am using the extensions for the framework and have been using the .NET Framework version until a recent project. I converted to the .NET Core version and noticed that a number of my calls to SQL are not being logged.

When I use the ExecuteStoredProcedureAsync call, nothing is logged.

Here is my setup:

protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
{
    // Log SQL messages
    optionsBuilder.LogTo(Filter, LogData);
    base.OnConfiguring(optionsBuilder);
}
protected bool Filter(EventId eventId, LogLevel logLevel)
{
    return (eventId.Id == 20100 || eventId.Id == 20101 || eventId.Id == 20102);
}

protected void LogData(Microsoft.EntityFrameworkCore.Diagnostics.EventData eventData)
{
}

How can I get the logging to work properly?

@JonathanMagnan JonathanMagnan self-assigned this Nov 15, 2024
@JonathanMagnan
Copy link
Member

Hello @rwoodslap ,

Unfortunately, it was easy to log through EF6, but that's another story for EF Core.

So, indeed, SQL call will not be logged for EF Core. And we do not believe this behavior will change as we tried multiple times to make it work correctly without success.

Best Regards,

Jon

@rwoodslap
Copy link
Author

If I get it to work, I will send you the code. I need it to work for my project.

@rwoodslap
Copy link
Author

Hello @rwoodslap ,

Unfortunately, it was easy to log through EF6, but that's another story for EF Core.

So, indeed, SQL call will not be logged for EF Core. And we do not believe this behavior will change as we tried multiple times to make it work correctly without success.

Best Regards,

Jon

Jon,
I was able to update the library, but I don't really use GitHub, so I emailed you the update I made to the file.
Thanks,
Robert Woods

@JonathanMagnan
Copy link
Member

Thank you @rwoodslap

We will look at it.

Best Regards,

Jon

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants