<PackageReference Include="OpenTelemetry" Version="1.20.0-rc.1" />

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 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)

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

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