Pino fast JSON logger for Node.js. Covers log levels, child loggers, transports, and redaction. Triggers on pino, logger, log.info, log.error.
Adds Pino structured JSON logging to Node.js apps. Triggers on `pino`, `logger`, `log.info`, or `log.error` patterns to configure log levels, child loggers, transports, and redaction for different environments.
/plugin marketplace add settlemint/agent-marketplace/plugin install devtools@settlemintThis skill inherits all available tools. When active, it can use any tool Claude has access to.
templates/logger-setup.ts.mdtemplates/request-logger.ts.md<mcp_first> CRITICAL: Fetch Pino documentation before implementing.
MCPSearch({ query: "select:mcp__plugin_devtools_octocode__githubSearchCode" })
// Pino configuration
mcp__octocode__githubSearchCode({
keywordsToSearch: ["pino", "logger", "transport"],
owner: "pinojs",
repo: "pino",
path: "lib",
mainResearchGoal: "Understand Pino logger configuration",
researchGoal: "Find logger setup patterns",
reasoning: "Need current API for Pino setup",
});
// Transports
mcp__octocode__githubSearchCode({
keywordsToSearch: ["pino-pretty", "transport", "destination"],
owner: "pinojs",
repo: "pino",
path: "docs",
mainResearchGoal: "Understand Pino transports",
researchGoal: "Find transport configuration patterns",
reasoning: "Need current API for log transports",
});
</mcp_first>
<quick_start> Templates:
| Template | Purpose |
|---|---|
templates/logger-setup.ts.md | Logger configuration with redaction |
templates/request-logger.ts.md | HTTP request middleware |
Basic usage:
import { logger } from "./logger";
logger.info("Server started");
logger.error({ err }, "Database connection failed");
With pretty printing (development):
import pino from "pino";
const logger = pino({
level: "debug",
transport: {
target: "pino-pretty",
options: {
colorize: true,
translateTime: "HH:MM:ss",
ignore: "pid,hostname",
},
},
});
Child loggers:
const requestLogger = logger.child({ requestId: req.id });
requestLogger.info("Processing request");
// Output: {"level":30,"requestId":"abc123","msg":"Processing request"}
</quick_start>
<log_levels>
| Level | Value | Use Case |
|---|---|---|
fatal | 60 | App crash |
error | 50 | Error conditions |
warn | 40 | Warning conditions |
info | 30 | Normal operations |
debug | 20 | Debug information |
trace | 10 | Detailed tracing |
| </log_levels> |
// Good - structured data
logger.info({ userId, action: "login" }, "User logged in");
// Bad - string interpolation
logger.info(`User ${userId} logged in`);
Error logging:
try {
await riskyOperation();
} catch (error) {
// Pass error as `err` property for proper serialization
logger.error({ err: error, context: "riskyOperation" }, "Operation failed");
}
Request logging middleware:
function requestLogger(req, res, next) {
const start = Date.now();
const log = logger.child({ requestId: req.id });
res.on("finish", () => {
log.info(
{
method: req.method,
url: req.url,
status: res.statusCode,
duration: Date.now() - start,
},
"Request completed",
);
});
req.log = log;
next();
}
Redaction (hide sensitive data):
const logger = pino({
redact: ["password", "creditCard", "*.secret", "users[*].token"],
});
logger.info({ password: "secret123" }); // password: "[Redacted]"
</patterns>
<transports>
**Multiple transports:**
import pino from "pino";
const logger = pino({
transport: {
targets: [
{
target: "pino-pretty",
options: { colorize: true },
level: "debug",
},
{
target: "pino/file",
options: { destination: "./app.log" },
level: "info",
},
],
},
});
Custom transport:
const logger = pino({
transport: {
target: "./my-transport.js",
options: { customOption: true },
},
});
</transports>
<constraints>
**Best practices:**
- Use structured data (objects) not string interpolation
- Pass errors as `err` property
- Use child loggers for context
- Redact sensitive fields
- Set appropriate log level per environment
Performance:
pino.destination() for sync in critical paths<success_criteria>
err propertyThis skill should be used when the user asks to "create an agent", "add an agent", "write a subagent", "agent frontmatter", "when to use description", "agent examples", "agent tools", "agent colors", "autonomous agent", or needs guidance on agent structure, system prompts, triggering conditions, or agent development best practices for Claude Code plugins.
This skill should be used when the user asks to "create a slash command", "add a command", "write a custom command", "define command arguments", "use command frontmatter", "organize commands", "create command with file references", "interactive command", "use AskUserQuestion in command", or needs guidance on slash command structure, YAML frontmatter fields, dynamic arguments, bash execution in commands, user interaction patterns, or command development best practices for Claude Code.
This skill should be used when the user asks to "create a hook", "add a PreToolUse/PostToolUse/Stop hook", "validate tool use", "implement prompt-based hooks", "use ${CLAUDE_PLUGIN_ROOT}", "set up event-driven automation", "block dangerous commands", or mentions hook events (PreToolUse, PostToolUse, Stop, SubagentStop, SessionStart, SessionEnd, UserPromptSubmit, PreCompact, Notification). Provides comprehensive guidance for creating and implementing Claude Code plugin hooks with focus on advanced prompt-based hooks API.