Class TestLogEntry

Namespace
XBullet.EasyTesting.Observability
Assembly
XBullet.EasyTesting.Observability.dll

One structured log entry captured from an integration-test host.

public sealed class TestLogEntry
Inheritance
TestLogEntry
Inherited Members

Constructors

TestLogEntry(DateTimeOffset, string, LogLevel, EventId, string, string?, IReadOnlyDictionary<string, object?>, IReadOnlyList<object?>, Exception?)

Creates one immutable captured log entry.

public TestLogEntry(DateTimeOffset timestamp, string category, LogLevel level, EventId eventId, string message, string? messageTemplate, IReadOnlyDictionary<string, object?> state, IReadOnlyList<object?> scopes, Exception? exception)

Parameters

timestamp DateTimeOffset

The absolute capture instant supplied by the collector's clock.

category string

The logger category.

level LogLevel

The log level.

eventId EventId

The event identifier and optional name.

message string

The formatted log message.

messageTemplate string

The original structured message template, or null when none was supplied.

state IReadOnlyDictionary<string, object>

The structured state. The dictionary is retained without copying and can contain sensitive or mutable values; callers should not mutate it after construction.

scopes IReadOnlyList<object>

The active scopes in outer-to-inner order. The list is retained without copying and can contain sensitive or mutable values; callers should not mutate it after construction.

exception Exception

The logged exception reference, or null when none was supplied. The exception is retained without cloning and remains owned by its creator.

Properties

Category

Gets the logger category.

public string Category { get; }

Property Value

string

The category supplied when the logger was created.

EventId

Gets the event identifier.

public EventId EventId { get; }

Property Value

EventId

The captured numeric event identifier and optional event name.

Exception

Gets the logged exception, when one was supplied.

public Exception? Exception { get; }

Property Value

Exception

The original exception reference, or null when none was logged. Its message and data are not redacted.

Level

Gets the log level.

public LogLevel Level { get; }

Property Value

LogLevel

The captured severity level.

Message

Gets the formatted log message.

public string Message { get; }

Property Value

string

The formatter output. It is not redacted and may contain sensitive data.

MessageTemplate

Gets the original message template when structured logging supplied one.

public string? MessageTemplate { get; }

Property Value

string

The original template, or null when structured logging did not supply one.

Scopes

Gets a stable copy of the active scopes.

public IReadOnlyList<object?> Scopes { get; }

Property Value

IReadOnlyList<object>

The retained scopes in outer-to-inner order. Values are not deep-cloned or redacted.

State

Gets a stable copy of the structured log state.

public IReadOnlyDictionary<string, object?> State { get; }

Property Value

IReadOnlyDictionary<string, object>

The retained read-only state dictionary. Values are not deep-cloned or redacted.

Timestamp

Gets the time at which the entry was captured.

public DateTimeOffset Timestamp { get; }

Property Value

DateTimeOffset

The absolute instant returned by the collector's time provider.