RehanSaeed/Serilog.Exceptions

[TaskCanceledExceptionDestructurer] Destructured object type inconsistent

Guymestef opened this issue · 1 comments

Describe the bug

When Task property is null, the string "null" is added to the property bag.
When Task is not null, an object is added to the property bag.

The inconsistent type for the property added to the bag is generating a conflict mapping issue when using elasticsearch sink to store logs, preventing the log to be successfully pushed to elasticsearch.

Steps to reproduce

When using elasticsearch sink, log a TaskCanceledException exception with null as Task
Then log a TaskCanceledException exception with a non null Task.

Expected behaviour

Consistent property bag type to be able to log TaskCanceledException

Fixed in #494