System.Diagnostics.CorrelationManager Class

Correlates traces that are part of a logical transaction.

See Also: CorrelationManager Members

Syntax

public class CorrelationManager

Remarks

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.

Note:

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

Requirements

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