SumoLogic/sumologic-net-appenders

Log message templates don't appear to work properly when using .NET Core Appender

Opened this issue · 0 comments

Greetings,

I implemented the message formatter function as described on this page:
https://github.com/SumoLogic/sumologic-net-appenders/blob/master/docs/sumologic.logging.aspnetcore.md

However, when logging using the .NET Core Log message template format the "properties" dictionary passed into the message formatter function does not contain any of the properties.

For example when calling the logger like this:

_logger.LogCritical("This is a test! {dateTimeUtc}, {testProperty}",DateTime.UtcNow.ToString("u"),"Test property");

I expected the properties dictionary to contain dateTimeUtc and testProperty with their corresponding values. However, when stepping through the debugger the message formatter function does not contain any properties.

The resulting output logged into sumologic looks like this:

{
"date":"2020-09-02 20:41:35.925 +00:00",
"message":"This is a test! 2020-09-02 20:41:35Z, Test property",
"level":"Critical",
"category":"PI.Core.API.Controllers.StrategySurveysController"
}

Can you confirm that this is a bug or let me know if I missed something?

Your assistance is greatly appreciated

Thank you