#601

Global Rank · of 601 Skills

pino-logging AI Agent Skill

View Source: oakoss/agent-skills

Safe

Installation

npx skills add oakoss/agent-skills --skill pino-logging

56

Installs

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

Installs

Installs 56
Global Rank #601 of 601

Security Audit

ath Safe
socket Safe
Alerts: 0 Score: 90
snyk Low
EU EU-Hosted Inference API

Power your AI Agents with the best open-source models.

Drop-in OpenAI-compatible API. No data leaves Europe.

Explore Inference API

GLM

GLM 5

$1.00 / $3.20

per M tokens

Kimi

Kimi K2.5

$0.60 / $2.80

per M tokens

MiniMax

MiniMax M2.5

$0.30 / $1.20

per M tokens

Qwen

Qwen3.5 122B

$0.40 / $3.00

per M tokens

How to use this skill

1

Install pino-logging by running npx skills add oakoss/agent-skills --skill pino-logging in your project directory. Run the install command above in your project directory. The skill file will be downloaded from GitHub and placed in your project.

2

No configuration needed. Your AI agent (Claude Code, Cursor, Windsurf, etc.) automatically detects installed skills and uses them as context when generating code.

3

The skill enhances your agent's understanding of pino-logging, helping it follow established patterns, avoid common mistakes, and produce production-ready output.

What you get

Skills are plain-text instruction files — not executable code. They encode expert knowledge about frameworks, languages, or tools that your AI agent reads to improve its output. This means zero runtime overhead, no dependency conflicts, and full transparency: you can read and review every instruction before installing.

Compatibility

This skill works with any AI coding agent that supports the skills.sh format, including Claude Code (Anthropic), Cursor, Windsurf, Cline, Aider, and other tools that read project-level context files. Skills are framework-agnostic at the transport level — the content inside determines which language or framework it applies to.

Data sourced from the skills.sh registry and GitHub. Install counts and security audits are updated regularly.

EU Made in Europe

Chat with 100+ AI Models in one App.

Use Claude, ChatGPT, Gemini alongside with EU-Hosted Models like Deepseek, GLM-5, Kimi K2.5 and many more.

Customer Support