Can you please explain on how we can set ActivityId in Semantic Logging by using .Net 4.5.1?
Asked
Active
Viewed 518 times
1 Answers
1
You can use the EventSource.SetCurrentThreadActivityId
to set the current thread activity ID. If you need to link two activity IDs then use the WriteEventWithRelatedActivityId method instead of the usual WriteEvent.
See Activity tracing and sampling for more information.

Randy Levy
- 22,566
- 4
- 68
- 94