Skip to content

createLogger

createLogger(config?): CreateLoggerResult

Defined in: observability/src/logger/create.ts:68

The single entry point for building a Pino-backed logger. Generates a runId, detects the environment, resolves the level, wires the right transports, and returns a ready Logger.

const { logger, runId } = createLogger({ level, axiom });
const log = logger.child({ command: "sync-github", repo });
log.info({ branch }, "opening PR");

For a browser / edge / React Native context, construct a ConsoleLogger directly instead — it needs no createLogger.

LoggerConfig = {}

CreateLoggerResult