Logging EF-core exceptions
Hi,
I'm doing some refactor for logging db exceptions.
What's good practice when logging db exceptions?
Atm I think it's good enough to just log the exception because then I get the full stack trace and all info even tho some info might be bloated?
My PL asked me If I could log more specific info about the exception but I don't really see the point.
Any suggestion or thoughts how you guys would do it?
3 Replies
Unknown User•3y ago
Message Not Public
Sign In & Join Server To View
Thanks!
when you are using serilog, there are some addons that improve exception logging:
https://github.com/RehanSaeed/Serilog.Exceptions
it lists some more specific ones that improve performance at the bottom of the page: https://github.com/RehanSaeed/Serilog.Exceptions#additional-destructurers
also mentions how to write your own destructures for custom exceptions: https://github.com/RehanSaeed/Serilog.Exceptions#custom-exception-destructurers