serilog-sinks-azure-analytics
serilog-sinks-azure-analytics copied to clipboard
FlattenObject=false not working for LogException
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
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.