| name | pino |
| description | Guides AI agents to use Pino logging correctly — levels, structured logs, child loggers, and Fastify integration. |
| metadata | {"tags":["pino","logging","fastify","nodejs"]} |
Pino Skill
Use this skill when writing any logging code with Pino: creating loggers, choosing log levels, adding context, or configuring Fastify's built-in logger.
When to Use
- Configuring the Fastify logger at startup
- Adding log statements to route handlers, plugins, or services
- Creating child loggers with bound context
- Logging errors with full detail
- Configuring log output for development vs. production
Rules
- rules/levels.md — When to use each log level (
trace, debug, info, warn, error, fatal).
- rules/structured-logging.md — How to write structured log entries with context objects.
- rules/child-loggers.md — Creating child loggers to bind persistent context (request ID, user ID, module name).
- rules/fastify-integration.md — Fastify logger configuration,
request.log, and serializers.
Quick Reference
const app = Fastify({ logger: true });
fastify.get('/users/:id', async (request) => {
request.log.info({ userId: request.params.id }, 'fetching user');
const user = await db.findUser(request.params.id);
if (!user) {
request.log.warn({ userId: request.params.id }, 'user not found');
throw fastify.httpErrors.notFound();
}
return user;
});
try {
await riskyOp();
} catch (err) {
request.log.error({ err }, 'riskyOp failed');
throw err;
}