Skip to content

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

@jficarapi

Description

@jficarapi

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions