NexusConfig.logger:
Values are fields, not text
The message is a stable literal and every value travels infields:
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):
console, for development:
Logger in for you - there is nothing to configure.
Why the SDK owns the interface
Node has nolog/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:
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.
A logger that throws is contained
A logger whose method throws never fails an SDK operation. Every internal log call is wrapped, so a failing sink - a full disk, a down syslog target - is dropped and the read, refresh, orcreate() that logged carries on. The stream observer is contained the same way. The Workload Identity credential source is deliberately not - it is on the auth path, so its error surfaces rather than being swallowed.
What is logged where
info is unused by the SDK today; it exists so an adapter does not have to guess.
Next
- Error handling
- Stream observer - the structured counterpart, for metrics rather than text
