Provides a pino-based structured logging pattern with request correlation IDs and PII redaction.
When to use
Adding or upgrading logging in any server-side module
Setting up observability for a new service
Replacing console.log calls in production code
Files
logger.template.ts — Pino-based structured logger with correlation + redaction
Setup
Install: pnpm add pino pino-pretty
Place at src/server/logger.ts
Use AsyncLocalStorage to propagate the request correlation ID through the request lifecycle
Conventions
Never log: passwords, full email addresses (log only domain part), credit card numbers, SSNs, auth tokens
Log levels: debug (dev only), info (key business events), warn (recoverable issues), error (exceptions + SLO breaches)
Every log line in a request context must include requestId
1---2name: structured-logger3description: Skill: structured-logger4---56# Skill: structured-logger78Provides a pino-based structured logging pattern with request correlation IDs and PII redaction.910## When to use11- Adding or upgrading logging in any server-side module12- Setting up observability for a new service13- Replacing `console.log` calls in production code1415## Files16- `logger.template.ts` — Pino-based structured logger with correlation + redaction1718## Setup191. Install: `pnpm add pino pino-pretty`202. Place at `src/server/logger.ts`213. Use `AsyncLocalStorage` to propagate the request correlation ID through the request lifecycle2223## Conventions24- Never log: passwords, full email addresses (log only domain part), credit card numbers, SSNs, auth tokens25- Log levels: `debug` (dev only), `info` (key business events), `warn` (recoverable issues), `error` (exceptions + SLO breaches)26- Every log line in a request context must include `requestId`
Run npx skillmds@latest add gabrielmoreira/structured-logger in your terminal (requires Node.js), paste this page's agent-chat prompt into Claude, Cursor, or any MCP-connected agent, or download the SKILL.md file and copy it into your agent's skills directory.
Skill: structured-logger It is listed under Coding & Dev Tools on SkillMD.
This skill has not completed SkillMD's automated safety review yet. Independent scanners report: SkillSpector: PASS, Skill Scanner: PASS. SkillMD never runs a skill's scripts for you; review the SKILL.md before installing.
This skill is tagged as working with Claude Code, Claude.ai, OpenAI Codex. SKILL.md is an open format, so most agents that read a skills directory can load it too.
Yes. Installing skills from SkillMD is free, and the skill stays under its author's original license.
gabrielmoreira (@gabrielmoreira) published this skill. Their other Agent Skills are listed on their SkillMD profile.