System.Diagnostics.CorrelationManager Class

Correlates traces that are part of a logical transaction.

See Also: CorrelationManager Members


public class CorrelationManager


Traces generated from a single logical operation can be tagged with an operation-unique identity, in order to distinguish them from traces from a different logical operation. For example, it may be useful to group correlated traces by ASP.NET request. The System.Diagnostics.CorrelationManager class provides methods used to store a logical operation identity in a thread-bound context and automatically tag each trace event generated by the thread with the stored identity.

Logical operations can also be nested. The CorrelationManager.LogicalOperationStack property exposes the stack of nested logical operation identities. Each call to the erload:System.Diagnostics.CorrelationManager.StartLogicalOperation method pushes a new logical operation identity onto the stack. Each call to the CorrelationManager.StopLogicalOperation method pops a logical operation identity off the stack.


Logical operation identities are objects, allowing the use of a type for a logical operation identity.


Namespace: System.Diagnostics
Assembly: System (in System.dll)
Assembly Versions:,