Skip to content
atarashi
Documentation menu

obs/pino

A shared Pino logger with pretty output in development and JSON lines in production.

Provides: logging, logging:pino

Requires: runtime:node, config:env

Conflicts with: logging

Files it writes

  • src/lib/logger.ts|js

Dependencies

  • pino@^9.13.1
  • pino-http@^10.5.0 (when has('http/express'))

Development only:

  • pino-pretty@^13.1.2

Environment

VariableRequiredDescription
LOG_LEVELnoPino log level: trace, debug, info, warn, error or fatal

What it contributes to other files

FileSlotLine
src/config/env.ts|jsenv-schemaLOG_LEVEL: z.enum(['trace', 'debug', 'info', 'warn', 'error', 'fatal']).default('info'),
src/app.ts|jsimportsimport { pinoHttp } from 'pino-http';
src/app.ts|jsimportsimport { logger } from './lib/logger.js';
src/app.ts|jsmiddlewareapp.use(pinoHttp({ logger }));

Use it

atarashi new my-app --add obs/pino
atarashi add obs/pino

Version 1.0.0. Format reference: Authoring blueprints.

Part of the atarashi documentation, written and maintained by Gautam Suthar.