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

Changing log level of DbUpdateConcurrencyException #30429

Closed
dandenton opened this issue Mar 7, 2023 · 4 comments · Fixed by #30445
Closed

Changing log level of DbUpdateConcurrencyException #30429

dandenton opened this issue Mar 7, 2023 · 4 comments · Fixed by #30445
Labels
area-interception area-logging area-save-changes closed-fixed The issue has been fixed and is/will be included in the release indicated by the issue milestone. customer-reported type-bug
Milestone

Comments

@dandenton
Copy link

We're in the process of updating from v6 to v7 and we're getting a lot more bloat in the logs when it comes to concurrency errors. It looks like that part of the changes for intercepting concurrency errors (which is great!) with #28315 changed that event to use the base event id of SaveChangesFailed = 10000 rather than OptimisticConcurrencyException = 10006

We've tried
options.ConfigureWarnings(w => w.Log((CoreEventId.OptimisticConcurrencyException, LogLevel.Debug)));
and
options.ConfigureWarnings(w => w.Ignore(CoreEventId.OptimisticConcurrencyException));
but it still logs as an error.

What is the recommended way of changing DbUpdateConcurrencyException logging from an error to debug? Do we really need to suppress all SaveChangesFailed errors?

@ajcvickers
Copy link
Contributor

Note for triage: this looks like a bug. SaveChangesFailed is getting logged in addition to OptimisticConcurrencyException.

@dandenton I don't think there is a way to filter out only the SaveChangesFailed events that are associated with OptimisticConcurrencyException events. So I think that, until this is fixed, its a matter of living with them or changing the level of all SaveChangesFailed events.

@ajcvickers ajcvickers self-assigned this Mar 9, 2023
ajcvickers added a commit that referenced this issue Mar 9, 2023
ajcvickers added a commit that referenced this issue Mar 13, 2023
@ajcvickers ajcvickers added closed-fixed The issue has been fixed and is/will be included in the release indicated by the issue milestone. and removed Servicing-consider labels Mar 13, 2023
@ajcvickers ajcvickers added this to the 8.0.0-preview3 milestone Mar 13, 2023
@blackenedstrang
Copy link

Any chances to have this addressed in EF Core 7, please?
Because we've recently migrated from v5.* to v7.0.3 and started to get a lot of such errors, and our monitoring tool goes nuts because of that...

Thank you!

@dandenton
Copy link
Author

I would note that we haven't seen any issues lowering the log level of all SaveChangesFailed errors.

builder.ConfigureWarnings(w => w.Log((CoreEventId.SaveChangesFailed, LogLevel.Debug)));

EF logs it as Debug then bubbles up the exception so we'd always end up logging it again anyway.

@blackenedstrang
Copy link

Ok, if it bubbles up the exception, then it should be fine. Thank you for the prompt answer.

@ajcvickers ajcvickers modified the milestones: 8.0.0-preview3, 8.0.0 Nov 14, 2023
@ajcvickers ajcvickers removed their assignment Aug 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-interception area-logging area-save-changes closed-fixed The issue has been fixed and is/will be included in the release indicated by the issue milestone. customer-reported type-bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants