Closed AplixaMartinMetzler closed 2 years ago
I think you are out of luck if you want to suppress logging only for unique constraint exceptions but you can disable logging for SaveChanges globally like this:
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
=> optionsBuilder
.ConfigureWarnings(b => b.Ignore(CoreEventId.SaveChangesFailed))
.LogTo(Console.WriteLine);
Ok, thanks for fast response. I will try that.
Hi @Giorgi
I am also seeing the "Failed executing DbCommand ..." being logged by entity framework. Would you happen to know what the EventId is for that message so that I can suppress it?
Thanks
-- Matthew
@Matthew-Bright CoreEventId.SaveChangesFailed
is the eventId not to log any error when SaveChanges
is called
Hi Giorgi,
first of all, thanks for your work, i really like this lib.
Its just a side question which i guess is more concern of ef-core, anyway:
Im working with postgres and i have this usecase:
At the moment of the catch clause EF-Core already has written already a log message:
Is there any possbility to supress this kind of messages?