diff --git a/framework/src/Bing.Logging/Bing/Logging/Log.cs b/framework/src/Bing.Logging/Bing/Logging/Log.cs index 19440e36..655aced3 100644 --- a/framework/src/Bing.Logging/Bing/Logging/Log.cs +++ b/framework/src/Bing.Logging/Bing/Logging/Log.cs @@ -269,7 +269,10 @@ protected virtual void ConvertStateToContent() { if (item.Value.SafeString().IsEmpty()) continue; - LogProperties.Add(item.Key, item.Value); + if (LogProperties.ContainsKey(item.Key)) + LogProperties[item.Key] = item.Value; + else + LogProperties.Add(item.Key, item.Value); } } diff --git a/framework/tests/Bing.Logging.Serilog.Tests/LogTest.cs b/framework/tests/Bing.Logging.Serilog.Tests/LogTest.cs index 0a98631a..c66a92e1 100644 --- a/framework/tests/Bing.Logging.Serilog.Tests/LogTest.cs +++ b/framework/tests/Bing.Logging.Serilog.Tests/LogTest.cs @@ -113,8 +113,9 @@ public void Test_LogTrace_Message_9() _log.EventId(119) .Message("Test_LogTrace_Message_9_{id}", $"id_{Id.NewString()}") .State(new Product { Code = "a", Name = "b", Price = 123 }) - .Property("Age","18") - .Property("Description","hello") + .Property("Code", "a") + .Property("Age", "18") + .Property("Description", "hello") .LogTrace(); } @@ -142,4 +143,4 @@ public void Test_LogTrace_Property_2() .State(new Product { Code = "a", Name = "b", Price = 123 }) .LogTrace(); } -} \ No newline at end of file +} diff --git a/version.props b/version.props index e3c32d2f..3afef173 100644 --- a/version.props +++ b/version.props @@ -2,7 +2,7 @@ 2 2 - 7 + 8 20221020-1 $(VersionMajor).$(VersionMinor).$(VersionPatch)