Skip to content

LoggerConfig

LoggerConfig = object

Defined in: types.ts:159

Configuration for createLogger.

optional context?: Record<string, unknown>

Defined in: types.ts:166

Static context merged into every record.


optional level?: LevelSetting

Defined in: types.ts:164

Minimum level to emit. Records below this are dropped. "silent" mutes the logger entirely. Defaults to "info".


optional now?: () => Date

Defined in: types.ts:178

Optional clock for deterministic tests. Defaults to () => new Date().

Date


optional onTransportError?: (error, info) => void

Defined in: types.ts:186

Diagnostic hook fired when a transport write or flush throws or rejects. Failures are still swallowed so logging keeps working — this hook is purely for observability (dev consoles, error tracking, etc.).

Inherited by child loggers created via logger.child().

unknown

TransportErrorInfo

void


optional scope?: string

Defined in: types.ts:168

Initial hierarchical scope (see child(name)).


optional scopeSeparator?: string

Defined in: types.ts:170

Separator used when nesting scopes via child(name). Defaults to ":".


optional timestamp?: TimestampFormat

Defined in: types.ts:174

How to format the record timestamp. Defaults to "iso".


optional transports?: Transport[]

Defined in: types.ts:172

Transports to fan out to. Defaults to [consoleTransport()].