Skip to content

LogContext.PushProperties not working with this sink? #28

@PaybackMan

Description

@PaybackMan

This is a similar question to what was asked from before but I'm trying to get Serilogs LogContext.PushProperties to work when this sink is setup. Basically I'm setting up a collection of Enrichers with values that I want to track (these values come into the service from the controller and I want every log entry down the stack to have them)

        using (LogContext.PushProperties(enrichers.ToArray()))
        {
            try
            {
               // Stuff happens here                  
            }
         }

None of these properties show up in AI (everything previously worked in Seq). The examples given for this in a previous post seemed to modify the TelemetryClients context on startup. I need this to work per call. Any examples that you guys know of that can get me pointed in the right direction?

Thanks

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