<PackageReference Include="OpenTelemetry" Version="1.21.0" />

OpenTelemetry.Internal.SelfDiagnosticsLogEntry

A fully-captured self-diagnostics log entry.

Gets the ActivityContext that was current when the entry was emitted, or null if no activity was active.

public bool BypassesMinimumLevel { get; }

Gets a value indicating whether the entry is admitted at any minimum level while diagnostics are enabled. Set for LogAlways events, which an EventSource delivers regardless of the subscribed level.

public EventId EventId { get; }

Gets the event id associated with the entry, if any.

public Exception Exception { get; }

Gets the exception associated with the entry, if any.

public LogLevel Level { get; }

Gets the level at which the entry was emitted.

public string Message { get; }

Gets the pre-rendered message text.

public long ThreadId { get; }

Gets the thread id captured when the entry was emitted. This is the OS thread id for entries sourced from EventSource events (on runtimes that expose it) and the managed thread id otherwise. Values <= 0 indicate the id was unavailable and render as dashes.

public DateTime TimestampUtc { get; }

Gets the UTC timestamp captured when the entry was emitted.

public SelfDiagnosticsLogEntry(DateTime timestampUtc, long threadId, LogLevel level, EventId eventId, string message, Exception exception, ActivityContext? activityContext, bool bypassesMinimumLevel = false)

public static SelfDiagnosticsLogEntry Capture(LogLevel level, EventId eventId, string message, Exception exception)

Captures a new entry using the current time, thread, and Current.