serilog-sinks-azure-analytics icon indicating copy to clipboard operation
serilog-sinks-azure-analytics copied to clipboard

FlattenObject=false not working for LogException

Open hedgelot opened this issue 3 years ago • 0 comments

Describe the bug When using FlattenObject=false it puts the LogProperties in 1 custom field instead of multiple as expected, but LogException still uses multiple custom fields, this causes a lot of Custom Fields to appear in Log Analytics.

To Reproduce Steps to reproduce the behavior: Throw an exception. I personally used an SqlException to test.

Expected behavior When FlattenObject=false I would expect that both LogProperties and LogException are using only 1 custom field each.

Ideally it would be nice if it can be configured seperately for LogProperties & LogException.

Screenshots image

This screenshot shows a single log from an SqlException. From an application that has configured FlattenObject as false. You can see it works for LogProperties_s, but does not work for LogException which still takes multiple fields.

hedgelot avatar Jul 26 '21 10:07 hedgelot