Serilog’s job, for Node. Here is how far along it is.
The goal is the role Serilog plays in .NET: the logging library you reach for in eight cases out of ten, because its model — templates, structured capture, context, sinks — is the right one, and everything else plugs into it. This page is the whole of Serilog’s feature set laid against logit, row by row. A row moves when the code does, never before.
- Available today
- 19
- Up next
- 5
- Planned
- 9
Available today
Available todayShipped and documented. Every row links to the page that explains it.
Named and positional holes,
@/$operators,:format,,alignment, brace escaping, cached parsing.Destructuring
Serilog · Destructure.ByTransforming · ToMaximumDepth · ToMaximumStringLength · ToMaximumCollectionCount
DocsStructural capture with
@, stringification with$,byTransformingpolicies, depth / string / collection limits, redaction by key or dotted path.Levels, overrides and switches
Serilog · MinimumLevel.Override · LoggingLevelSwitch · restrictedToMinimumLevel
DocsSix levels, per-source minimums matched on dotted prefixes, a
LevelSwitchfor runtime changes, per-sinkrestrictedToMinimumLevel.Enrichers and LogContext
Serilog · Enrich.FromLogContext · Enrich.WithProperty · LogContext.PushProperty · IDiagnosticContext
DocsFixed, computed and ambient properties;
LogContext.run()on AsyncLocalStorage;push()forusing; a diagnostic context for request-completion events.Filters, sampling, rate limiting
Serilog · Filter.ByExcluding · Filter.ByIncludingOnly · Matching
DocsbyExcluding,byIncludingOnly,Matching.fromSource/withProperty/withTemplate, plussampled()andrateLimited().Pretty on a terminal, JSON on a pipe, CLEF or a text output template on request; stderr from a level; the browser console with real objects.
Synchronous appends (nothing lost on a crash), rolling by minute / hour / day / month and by size, a retained-file count.
Batches with a size and an interval, retries with backoff, a bounded queue, NDJSON / array / CLEF bodies,
pagehideflush in browsers.CLEF over HTTP to
/ingest/clefwith the API key header — Seq’s native format,@ievent types and all.OTLP/HTTP JSON to any collector without the SDK, honouring
OTEL_EXPORTER_OTLP_*; or a bridge sink that hands events to an SDKLoggerProvider.{Timestamp:HH:mm:ss} [{Level:u3}] {Message:lj}{NewLine}{Exception}and every token Serilog’s text formatter knows, with the .NET date and number patterns.@t,@mt,@l,@x,@i(Jenkins one-at-a-time over the template, as Seq computes it),@rrenderings,@tr/@sp,@@escaping.Sub-loggers, conditional, audit and map sinks
Serilog · WriteTo.Logger · WriteTo.Conditional · AuditTo · Serilog.Sinks.Map
DocsA logger is a sink.
conditional()routes by predicate,audit()makes a sink’s failure the caller’s,mapSink()opens one sink per key.Request logging for Next.js and Express
Serilog · Serilog.AspNetCore · UseSerilogRequestLogging · IDiagnosticContext
DocsOne completion event per request with method, path, status and elapsed time; a diagnostic context;
withLogging()for route handlers and middleware,createOnRequestError()for instrumentation,requestLogger()for Express.beginOperation(),complete()/abandon()/enrich(),usingsupport,timed()for a function,warnAfter.Plain options or the fluent
LoggerConfiguration;LOGIT_LEVELandLOGIT_OVERRIDESfrom the environment; a globallogthatconfigure()reconfigures in place.The logger’s own diagnostics, off by default;
flush()/close()drain every buffering sink;closeOnExit()hooks signals and crashes.interceptConsole()routesconsole.*through the logger, so a framework’s own output comes out in the same shape.The root entry runs in Node, Bun, Deno, the Next.js edge runtime and browsers; Node extras, Next.js, Express and OpenTelemetry are subpath imports.
Up next
Up nextThe next things we build, in this order. Each is a real piece of work — the note says why.
Expression language
Serilog · Serilog.Expressions
Filters, conditional sinks and
ExpressionTemplateformatting written as text —RequestPath like '/health%'— instead of predicates in code.Why it’s big · A parser, an evaluator over captured values and a test corpus of its own; configuration files cannot express routing until it exists.
Configuration from JSON and env
Serilog · Serilog.Settings.Configuration
A whole logger from a JSON document or environment variables, with a registry that maps sink names to sinks.
Why it’s big · Anything beyond levels and sink names needs the expression language first; today
LOGIT_LEVELandLOGIT_OVERRIDEScover the common part.Durable HTTP and Seq shipping
Serilog · Serilog.Sinks.Seq (durable) · Serilog.Sinks.Http (durable)
A disk buffer in front of the network, so events written while the collector is down are sent after a restart.
Why it’s big · A file-backed queue with bookmarks, size limits and recovery from a half-written file — the retry queue today lives in memory.
Remote level control
Serilog · Serilog.Sinks.Seq · controlLevelSwitch
Seq (or any endpoint) tells the logger which minimum level to run at, and a
LevelSwitchfollows.Why it’s big · A polling protocol against the server’s API key settings plus the switch plumbing in the HTTP sink.
Automatic trace context
Serilog · LogEvent.TraceId / SpanId from Activity.Current
Trace and span ids read from the active OpenTelemetry span on every event, with no getter to write.
Why it’s big · An optional peer dependency on
@opentelemetry/apiand a context-propagation story for the edge;withTraceContext(getter)is the manual form today.
Planned
PlannedWorth doing, not yet scheduled. Most have a workable path today; the note says which.
Vendor sink packages
Serilog · Serilog.Sinks.Datadog.Logs · Serilog.Sinks.Grafana.Loki · Serilog.Sinks.Splunk · Serilog.Sinks.Elasticsearch · …
Datadog, Grafana Loki, Splunk HEC, Elasticsearch / ECS, CloudWatch, Application Insights, Sentry.
Why it’s big · Each is a body format plus an auth scheme plus a field mapping;
httpSinkwith headers and the JSON formatter’s key remapping gets most of them today.Worker-thread transports
Serilog · Serilog.Sinks.Async
Heavy sinks run off the event loop, the way pino transports do.
Why it’s big · Serialising events across threads, back-pressure and a clean shutdown; the batching sinks already keep network I/O off the hot path.
Pattern-based masking
Serilog · Serilog.Enrichers.Sensitive
Emails, IBANs, card numbers and your own patterns masked inside any string, not only by key.
Why it’s big · Regex sets with false-positive rules and a performance budget per event; key-based redaction exists today.
Error destructurers
Serilog · Serilog.Exceptions
Per-type capture for Prisma, Axios and fetch
Responseerrors, so the useful fields come through and the noise does not.Why it’s big · One policy per library, kept current with their error shapes;
byTransforminglets an application write its own now.Caller-info enricher
Serilog · Serilog.Enrichers.CallerInfo
File and line of the logging call, opt-in, Node only.
Why it’s big · Stack capture per event is expensive and source maps make the answer wrong without extra work.
Buffered file sink with archive hooks
Serilog · Serilog.Sinks.File (buffered, hooks)
Asynchronous file writes, and a hook when a file rolls — gzip it, upload it.
Why it’s big · Buffering trades the crash-safety of the synchronous sink for throughput; both have to stay available.
Client-side helper for Next.js
Serilog · —
A browser logger wired to a route handler, with the user and page attached.
Why it’s big · Mostly conventions:
httpSinkalready runs in the browser and flushes onpagehide.Fastify, Hono, Koa, NestJS
Serilog · Serilog.AspNetCore for the other hosts
Request logging and a
LoggerServicefor the other servers.Why it’s big · Each has its own hook lifecycle; the shared request-scope code is written, the adapters are not.
pino-compatible stream
Serilog · —
Write pino-shaped JSON into pino transports, for teams that already run them.
Why it’s big · pino’s line format and level numbers are the easy part; transport lifecycles are not.