pino-logging
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.
What this skill does
# Pino Logging
High-performance JSON logger for Node.js. Transports run in worker threads to keep the main event loop free. Produces NDJSON by default with automatic `level`, `time`, `pid`, `hostname`, and `msg` fields.
**When to use:** Structured logging in Node.js applications, request-scoped logging with correlation IDs, sensitive data redaction, multi-destination log routing, framework logging integration.
**When NOT to use:** Browser-only logging (pino has limited browser support), simple `console.log` debugging during development, projects that need human-readable logs by default (pino outputs JSON; use `pino-pretty` for dev).
**Package:** `pino` (v10+)
## Quick Reference
| Pattern | API | Key Points |
| ------------------- | ----------------------------------- | --------------------------------------------- |
| Basic logger | `pino()` | Defaults: level `info`, JSON to stdout |
| Set level | `pino({ level: 'debug' })` | `fatal > error > warn > info > debug > trace` |
| Log with context | `logger.info({ userId }, 'msg')` | First arg is merged object, second is message |
| Error logging | `logger.error({ err }, 'failed')` | Pass errors as `err` key for serialization |
| Child logger | `logger.child({ requestId })` | Bindings persist on all child logs |
| Redaction | `pino({ redact: ['password'] })` | Paths use dot notation, supports wildcards |
| Transport (worker) | `pino({ transport: { target } })` | Runs in worker thread, non-blocking |
| Multiple transports | `transport: { targets: [...] }` | Different levels per destination |
| Pretty print (dev) | `target: 'pino-pretty'` | Dev only — not for production |
| File transport | `target: 'pino/file'` | Built-in, with `mkdir` option |
| Rotating files | `target: 'pino-roll'` | Size and time-based rotation |
| HTTP middleware | `pinoHttp()` from `pino-http` | Auto request/response logging |
| Request ID | `genReqId` option in pino-http | Generate or forward `X-Request-Id` |
| Serializers | `serializers: { req, res, err }` | Transform objects before logging |
| Formatters | `formatters: { level, log }` | Rename fields, transform output |
| Custom levels | `customLevels: { http: 35 }` | Add levels between built-in ones |
| Async destination | `pino.destination({ sync: false })` | Buffered async writes |
| Fastify | `fastify({ logger: true })` | Built-in pino, `request.log` |
| Hono | `hono-pino` middleware | `c.get('logger')` in handlers |
## Common Mistakes
| Mistake | Fix |
| ------------------------------------------ | ----------------------------------------------------------------------- |
| Using `pino-pretty` in production | Use JSON output in production; pretty-print only in dev via `transport` |
| Logging sensitive data (tokens, passwords) | Use `redact` option with paths to sensitive fields |
| Creating a new logger per request | Use `logger.child({ requestId })` for request-scoped context |
| Blocking main thread with file writes | Use `pino.transport()` — runs in a worker thread |
| Using `JSON.stringify` on errors | Pass errors as `{ err }` — pino serializes stack, cause chain |
| Not forwarding `X-Request-Id` header | Use `genReqId` in pino-http to check headers first |
| Logging inside hot loops | Check `logger.isLevelEnabled('debug')` before expensive operations |
| Missing `fetch-depth: 0` with transports | Transports are separate packages — install them as dependencies |
## Delegation
> If the `hono` skill is available, delegate Hono middleware and routing patterns to it.
> If the `vitest-testing` skill is available, delegate test setup and mocking patterns to it.
> If the `sentry-setup-logging` skill is available, delegate Sentry integration to it — it covers `Sentry.pinoIntegration()` for forwarding pino logs to Sentry.
> Otherwise, recommend: `pnpm dlx skills add getsentry/sentry-for-claude -s sentry-setup-logging -a claude-code -y`
## References
- [Setup, configuration, and core API](references/setup-and-configuration.md)
- [Transports, destinations, and log routing](references/transports.md)
- [Child loggers, serializers, and redaction](references/child-loggers-and-redaction.md)
- [HTTP logging, correlation IDs, and framework integrations](references/http-and-frameworks.md)
Related in Backend & APIs
jfrog
IncludedInteract with the JFrog Platform via the JFrog CLI and REST/GraphQL APIs. Use this skill when the user wants to manage Artifactory repositories, upload or download artifacts, manage builds, configure permissions, manage users and groups, work with access tokens, configure JFrog CLI servers, search artifacts, manage properties, set up replication, manage JFrog Projects, run security audits or scans, look up CVE details, query exposures scan results from JFrog Advanced Security, manage release bundles and lifecycle operations, aggregate or export platform data, or perform any JFrog Platform administration task. Also use when the user mentions jf, jfrog, artifactory, xray, distribution, evidence, apptrust, onemodel, graphql, workers, mission control, curation, advanced security, exposures, or any JFrog product name.
cupynumeric-migration-readiness
IncludedPre-migration readiness assessor for porting NumPy to cuPyNumeric. Use BEFORE substantial porting work begins when the user asks whether code will scale on GPU, whether they should migrate to cuPyNumeric, which NumPy patterns transfer cleanly, what must be refactored before porting, or mentions pre-port assessment, scaling analysis, or refactor planning. Inspect the user's source code, look up NumPy usage, cross-reference the cuPyNumeric API support manifest, and distinguish distributed-scaling-friendly patterns from blockers such as unsupported APIs, scalar synchronization, host round-trips, Python/object-heavy control flow, shape/data-dependent branching, and in-place mutation hazards. Produce a verdict of READY, LIGHT REFACTOR, SIGNIFICANT REFACTOR, or NOT RECOMMENDED, with concrete refactor pointers.
alibabacloud-data-agent-skill
IncludedInvoke Alibaba Cloud Apsara Data Agent for Analytics via CLI to perform natural language-driven data analysis on enterprise databases. Data Agent for Analytics is an intelligent data analysis agent developed by Alibaba Cloud Database team for enterprise users. It automatically completes requirement analysis, data understanding, analysis insights, and report generation based on natural language descriptions. This tool supports: discovering data resources (instances/databases/tables) managed in DMS, initiating query or deep analysis sessions, real-time progress tracking, and retrieving analysis conclusions and generated reports. Use this Skill when users need to query databases, analyze data trends, generate data reports, ask questions in natural language, or mention "Data Agent", "data analysis", "database query", "SQL analysis", "data insights".
token-optimizer
IncludedReduce OpenClaw token usage and API costs through smart model routing, heartbeat optimization, budget tracking, and native 2026.2.15 features (session pruning, bootstrap size limits, cache TTL alignment). Use when token costs are high, API rate limits are being hit, or hosting multiple agents at scale. The 4 executable scripts (context_optimizer, model_router, heartbeat_optimizer, token_tracker) are local-only — no network requests, no subprocess calls, no system modifications. Reference files (PROVIDERS.md, config-patches.json) document optional multi-provider strategies that require external API keys and network access if you choose to use them. See SECURITY.md for full breakdown.
resend-cli
IncludedUse this skill when the task is specifically about operating Resend from an AI agent, terminal session, or CI job via the official resend CLI: installing/authenticating the CLI, sending/listing/updating/cancelling emails, batch sends, domains and DNS, webhooks and local listeners, inbound receiving, contacts, topics, segments, broadcasts, templates, API keys, profiles, or debugging Resend CLI/API failures. Trigger on mentions of Resend CLI, `resend`, `resend doctor`, `resend emails send`, `resend domains`, `resend webhooks listen`, `resend emails receiving`, or agent-friendly terminal automation.
alibabacloud-odps-maxframe-coding
IncludedUse this skill for MaxFrame SDK development and documentation navigation on Alibaba Cloud MaxCompute (ODPS). Helps answer MaxFrame API, concept, official example, and supported pandas API questions; create data processing programs; read/write MaxCompute tables; debug jobs (remote or local); and build custom DPE runtime images. Trigger when users mention MaxFrame, MaxCompute with MaxFrame, ODPS table processing, DPE runtime, MaxFrame docs/examples, DataFrame/Tensor operations, or GPU runtime setup. Works for both English and Chinese queries about Alibaba Cloud data processing with MaxFrame.