Skip to main content

Function: createLogger()

createLogger(options): Logger

Defined in: packages/common/src/logger.ts:52

Builds the one logger a service uses: structured JSON, one line per event, carrying service, and correlationId, tenantId and traceId from the ambient currentContext.

Redaction cannot be switched off. Every object field, binding and message string passes through redact / scrubString before it is serialised, which covers errors (where keys usually escape) and child-logger bindings. The caller must not rely on it as permission to log secrets: it is the net, not the policy.

It does not export traces or logs over OTLP; that is slice 1.

Parameters​

options​

LoggerOptions

Returns​

Logger