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

OpenTelemetry.Logs.LogRecord

public sealed class LogRecord
Stores details about a log message.
public IReadOnlyList<KeyValuePair<string, object>> Attributes { get; set; }

Gets or sets the attributes attached to the log.

public string Body { get; set; }

Gets or sets the log body.

public string CategoryName { get; set; }

Gets or sets the log category name.

public EventId EventId { get; set; }

Gets or sets the log EventId.

public Exception Exception { get; set; }

Gets or sets the log Exception.

public string FormattedMessage { get; set; }

Gets or sets the log formatted message.

public LogLevel LogLevel { get; set; }

Gets or sets the log LogLevel.

public ActivitySpanId SpanId { get; set; }

Gets or sets the log ActivitySpanId.

public object State { get; set; }

Gets or sets the raw state attached to the log.

public IReadOnlyList<KeyValuePair<string, object>> StateValues { get; set; }

Gets or sets the state values attached to the log.

public DateTime Timestamp { get; set; }

Gets or sets the log timestamp.

public ActivityTraceFlags TraceFlags { get; set; }

Gets or sets the log ActivityTraceFlags.

public ActivityTraceId TraceId { get; set; }

Gets or sets the log ActivityTraceId.

public string TraceState { get; set; }

Gets or sets the log trace state.

public void ForEachScope<TState>(Action<LogRecordScope, TState> callback, TState state)

Executes callback for each currently active scope objects in order of creation. All callbacks are guaranteed to be called inline from this method.