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.1pino-http@^10.5.0(whenhas('http/express'))
Development only:
pino-pretty@^13.1.2
Environment
| Variable | Required | Description |
|---|---|---|
LOG_LEVEL | no | Pino log level: trace, debug, info, warn, error or fatal |
What it contributes to other files
| File | Slot | Line |
|---|---|---|
src/config/env.ts|js | env-schema | LOG_LEVEL: z.enum(['trace', 'debug', 'info', 'warn', 'error', 'fatal']).default('info'), |
src/app.ts|js | imports | import { pinoHttp } from 'pino-http'; |
src/app.ts|js | imports | import { logger } from './lib/logger.js'; |
src/app.ts|js | middleware | app.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.