Update logger scope state in Flowchart activity

The logger scope state within the Flowchart activity has been updated to use the current managed thread ID from the Environment class. Additionally, a new property 'TaskId' has been incorporated for providing the current task ID, defaulting to 'N/A' in case null.
This commit is contained in:
Sipke Schoorstra 2024-06-06 12:03:47 +02:00
parent dc2184fba4
commit 07c889f489

View file

@ -141,7 +141,8 @@ public class Flowchart : Container
var logger = context.GetRequiredService<ILogger<Flowchart>>();
var loggerScopeState = new Dictionary<string, object>
{
["ThreadId"] = Thread.CurrentThread.ManagedThreadId,
["ThreadId"] = Environment.CurrentManagedThreadId,
["TaskId"] = Task.CurrentId?.ToString() ?? "N/A",
["ActivityId"] = Id,
["ActivityInstanceId"] = context.TargetContext.Id
};