Skip to content

Commit

Permalink
😊 修复 设置日志上下文出现相同 Key 导致异常问题
Browse files Browse the repository at this point in the history
  • Loading branch information
MonkSoul committed Aug 15, 2024
1 parent 11c7ef8 commit 8d77141
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion framework/Furion.Pure/Logging/Internal/Penetrates.cs
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,8 @@ internal static LogContext SetLogContext(IExternalScopeProvider scopeProvider, b
var logConext = new LogContext
{
Properties = contexts.SelectMany(p => p.Properties)
.ToDictionary(u => u.Key, u => u.Value),
.GroupBy(p => p.Key)
.ToDictionary(u => u.Key, u => u.FirstOrDefault().Value),
Scopes = scopes
};

Expand Down
3 changes: 2 additions & 1 deletion framework/Furion/Logging/Internal/Penetrates.cs
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,8 @@ internal static LogContext SetLogContext(IExternalScopeProvider scopeProvider, b
var logConext = new LogContext
{
Properties = contexts.SelectMany(p => p.Properties)
.ToDictionary(u => u.Key, u => u.Value),
.GroupBy(p => p.Key)
.ToDictionary(u => u.Key, u => u.FirstOrDefault().Value),
Scopes = scopes
};

Expand Down

0 comments on commit 8d77141

Please sign in to comment.