Skip to main content
Changed in v0.11.0 - the logger interface is structured and has four levels. The SDK writes its diagnostics to whatever you pass as NexusConfig.logger:

Values are fields, not text

The message is a stable literal and every value travels in fields:
This is what makes the output usable in an aggregator. A message that interpolates its values produces a unique string per occurrence, so nothing can group them, count them, or alert on them - you can only grep. With fields, “how many syncs failed in the last hour” and “show me every record where component is stream” are queries. Every record carries a component field naming the subsystem that produced it: client, stream, or wif.

Adapters

pino - note the argument order is (fields, message):
winston:
console, for development:
In NestJS, the module bridges Nest’s own Logger in for you - there is nothing to configure.

Why the SDK owns the interface

Node has no log/slog in its standard library, and the two most widely used loggers disagree on argument order: pino takes (fields, message), winston takes (message, meta). Adopting either signature would force that library’s shape on every consumer. The SDK therefore defines four methods, depends on nothing, and documents the three-line adapter.

When you pass nothing

debug and info are discarded - a library must not write to your output uninvited - while warn and error become Node process warnings:
So a failing background refresh is still discoverable with nothing configured. Pass NOOP_LOGGER to silence even that. Newlines in a rendered value are collapsed to spaces, so a multi-line value cannot forge additional log records.

Secrets never reach the logger

Not their values, and not their key names - a key names what its value is for, which is why v0.5.1 hashed it out of the filesystem path too. This is enforced rather than intended: a test drives a sync carrying both a text secret and a file-type secret through a capturing logger at debug level, and fails if either value, or either key, appears anywhere in the output. Records about secrets report counts (fileSecrets: 1), never identities.

What is logged where

info is unused by the SDK today; it exists so an adapter does not have to guess.

Next