Share via


LoggerContext Class

Definition

A context class that can be used to store work per request to aid with debugging.

public class LoggerContext
type LoggerContext = class
Public Class LoggerContext
Inheritance
LoggerContext
Derived

Constructors

LoggerContext()

Instantiates a new LoggerContext with the default activityId.

LoggerContext(Guid)

Instantiates a new LoggerContext with an activityId.

Properties

ActivityId

Gets or set a Guid that will be used in the call to EventSource.SetCurrentThreadActivityId before logging.

CaptureLogs

Gets or sets a boolean controlling if logs are written into the context. Useful when debugging.

DebugId

Gets or sets a string that helps with setting breakpoints when debugging.

Logs

The collection of logs associated with a request. Use CaptureLogs to control capture.

PropertyBag

Gets or sets an IDictionary<TKey,TValue> that enables custom extensibility scenarios.

Applies to