Serilog.Exceptions icon indicating copy to clipboard operation
Serilog.Exceptions copied to clipboard

Support for limiting entries in DbUpdateExceptionDestructurer

Open mrtristan opened this issue 2 years ago • 4 comments

We have to use DbUpdateExceptionDestructurer for the reasons expressed in the Readme, however some of our processes yield rather large updates that may fail which leads to absolutely massive log entries when an exception is thrown. This causes impact down the line as the logs get shipped to services like Datadog which stop parsing log lines at a certain size which leads to partial unprocessable json, etc.

I think the cleanest way to handle this situation is to have an opt-in concept of a maximum quantity of entries that are present in the log.

mrtristan avatar Jan 12 '23 03:01 mrtristan

This question turns up now and again. Would this help?

https://github.com/RehanSaeed/Serilog.Exceptions/issues/397#issuecomment-1132647325

RehanSaeed avatar Jan 27 '23 11:01 RehanSaeed

@RehanSaeed no, it's less about which properties and more about how many properties across how many objects yielding the log size. i'm not limiting properties in this PR, just how many objects in total are emitted with a hint to say what's been truncated

mrtristan avatar Jan 27 '23 14:01 mrtristan

I also would like to limit the number of entries which will be logged. How can I help so we can merge this PR :) ?

krzysiek-b avatar Dec 04 '23 18:12 krzysiek-b