Can you please explain on how we can set ActivityId in Semantic Logging by using .Net 4.5.1

541 views Asked by At

Can you please explain on how we can set ActivityId in Semantic Logging by using .Net 4.5.1?

1

There are 1 answers

0
Randy Levy On

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.