Seq 2024.1 will support trace (span) ingestion, but Serilog doesn't have a built-in way to annotate LogEvents with span start times or parent span ids.
This PR adds support for passing an ITextFormatter to the various Seq() sink configuration methods, and using that formatter to construct newline-delimited JSON payloads.
Hypothetically, if an enricher provides span starts in SpanStart and parent span ids in ParentSpanId, these could be sent to Seq in the @st and @ps payload properties using:
Log.Logger = new LoggerConfiguration()
.WriteTo.Seq(
"https://seq.example.com",
payloadFormatter: new ExpressionTemplate(
"{ {@t, @mt, @l: if @l = 'Information' then undefined() else @l, @x, @sp, @tr, @ps: ParentSpanId, @st: SpanStart, @ra: {service: {name: 'Example'}}, ..rest()} }\n"))
.CreateLogger();
Seq 2024.1 will support trace (span) ingestion, but Serilog doesn't have a built-in way to annotate
LogEvent
s with span start times or parent span ids.This PR adds support for passing an
ITextFormatter
to the variousSeq()
sink configuration methods, and using that formatter to construct newline-delimited JSON payloads.Hypothetically, if an enricher provides span starts in
SpanStart
and parent span ids inParentSpanId
, these could be sent to Seq in the@st
and@ps
payload properties using: