ASP.NET Core Serilog to Loggly not showing json property

274 Views Asked by At

Our application uses the Serilog NuGet package to write logs to Loggly, and I am using GlobalLogContextto add a custom property like this:

using (GlobalLogContext.PushProperty("TransactionActivityId", activityId))
{
    _logger.LogInformation("Test log message");
}

We also set up the logger by doing

.UseSerilog((context, loggerConfiguration) => loggerConfiguration
    .ReadFrom.Configuration(context.Configuration)
    .Enrich.FromGlobalLogContext())

In Loggly, I see the property in the "raw message" section, but the custom property is not showing up in the json section. enter image description here

What has to be done in order for Loggly to show this property in the json section?

0

There are 0 best solutions below