The package Serilog.Exceptions is nice for logging exceptions. It has a large list of supported exception types.
e.g. the current setup:
Log.Logger = new LoggerConfiguration()
.Enrich.WithExceptionDetails()
.CreateLogger();
Currently it falls back to a "reflection based destructurer" if no destructurer is found for a exception type.
Because of performance, but more important of predictability, we would like to disable the reflection fallback.
I tried configuring this with DestructuringOptions, e.g. disable some of the default destructors or setting the DestructuringDepth to 0.
Unfortunately, those options won't work:
- the
ReflectionBasedDestructurerisn't in the default destructor list - setting
DestructuringDepthto0isn't allowed (exception)
Any idea how to configure Serilog.Exceptions for this?