diff --git a/src/Elastic.CommonSchema.Serilog/HttpContextEnricher.cs b/src/Elastic.CommonSchema.Serilog/HttpContextEnricher.cs index 12a842c7..a7ce0f97 100644 --- a/src/Elastic.CommonSchema.Serilog/HttpContextEnricher.cs +++ b/src/Elastic.CommonSchema.Serilog/HttpContextEnricher.cs @@ -46,7 +46,7 @@ public void Enrich(LogEvent logEvent, ILogEventPropertyFactory propertyFactory) r.User = Adapter.User; } - logEvent.AddPropertyIfAbsent(propertyFactory.CreateProperty(PropertyName, r)); + logEvent.AddPropertyIfAbsent(new LogEventProperty(PropertyName, new ScalarValue(r))); } internal class HttpContextEnrichments