Loading...
Loading...
Pino high-performance JSON logger for Node.js with worker thread transports, child loggers, redaction, and framework integrations. Use when setting up structured logging, configuring log transports, adding request correlation IDs, redacting sensitive data, or integrating with Fastify, Hono, or Express. Use for pino, logging, structured-logs, request-id, correlation, redaction, transports, pino-http, pino-pretty.
npx skill4agent add oakoss/agent-skills pino-loggingleveltimepidhostnamemsgconsole.logpino-prettypino| Pattern | API | Key Points |
|---|---|---|
| Basic logger | | Defaults: level |
| Set level | | |
| Log with context | | First arg is merged object, second is message |
| Error logging | | Pass errors as |
| Child logger | | Bindings persist on all child logs |
| Redaction | | Paths use dot notation, supports wildcards |
| Transport (worker) | | Runs in worker thread, non-blocking |
| Multiple transports | | Different levels per destination |
| Pretty print (dev) | | Dev only — not for production |
| File transport | | Built-in, with |
| Rotating files | | Size and time-based rotation |
| HTTP middleware | | Auto request/response logging |
| Request ID | | Generate or forward |
| Serializers | | Transform objects before logging |
| Formatters | | Rename fields, transform output |
| Custom levels | | Add levels between built-in ones |
| Async destination | | Buffered async writes |
| Fastify | | Built-in pino, |
| Hono | | |
| Mistake | Fix |
|---|---|
Using | Use JSON output in production; pretty-print only in dev via |
| Logging sensitive data (tokens, passwords) | Use |
| Creating a new logger per request | Use |
| Blocking main thread with file writes | Use |
Using | Pass errors as |
Not forwarding | Use |
| Logging inside hot loops | Check |
Missing | Transports are separate packages — install them as dependencies |
If theskill is available, delegate Hono middleware and routing patterns to it. If thehonoskill is available, delegate test setup and mocking patterns to it. If thevitest-testingskill is available, delegate Sentry integration to it — it coverssentry-setup-loggingfor forwarding pino logs to Sentry. Otherwise, recommend:Sentry.pinoIntegration()pnpm dlx skills add getsentry/sentry-for-claude -s sentry-setup-logging -a claude-code -y