From d7b475203814f8621fcf9662848a1be2b7abc94b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Kurzyniec?= Date: Tue, 12 Nov 2019 01:07:31 +0100 Subject: [PATCH] Fixing null in log entry when CorrelationIdHeaderEnricher --- .../Enrichers/CorrelationIdHeaderEnricher.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Serilog.Enrichers.CorrelationId/Enrichers/CorrelationIdHeaderEnricher.cs b/src/Serilog.Enrichers.CorrelationId/Enrichers/CorrelationIdHeaderEnricher.cs index 917e3b7..4494549 100644 --- a/src/Serilog.Enrichers.CorrelationId/Enrichers/CorrelationIdHeaderEnricher.cs +++ b/src/Serilog.Enrichers.CorrelationId/Enrichers/CorrelationIdHeaderEnricher.cs @@ -37,7 +37,7 @@ public void Enrich(LogEvent logEvent, ILogEventPropertyFactory propertyFactory) var correlationIdProperty = new LogEventProperty(CorrelationIdPropertyName, new ScalarValue(correlationId)); - logEvent.AddPropertyIfAbsent(correlationIdProperty); + logEvent.AddOrUpdateProperty(correlationIdProperty); } private string GetCorrelationId()