pino-logging

Standardize structured logging with request-scoped loggers and sensitive header redaction.

Updated Mar 4, 2026
One-click install
npx skills add https://github.com/sncollective/snc-platform --skill pino-logging-sncollective
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: pino-logging
Source: https://github.com/sncollective/snc-platform/tree/main/.claude/skills/pino-logging
Command: npx skills add https://github.com/sncollective/snc-platform --skill pino-logging-sncollective

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Inconsistent logging leads to noisy output and missing audit trails; this Skill enforces a unified, structured logging approach for the SNC platform.

Core Features & Use Cases

  • Root and request‑scoped loggers accessed via rootLogger or c.var.logger to automatically include request context.
  • Clear log level guidance defining when to use info, warn, and error.
  • Audit event pattern requiring an event field for security‑relevant actions.
  • Redaction of sensitive headers and prohibition of console.log or creating new pino instances.

Example: Adding c.var.logger.info({contentId}, "Content published") in a route logs the content ID with request metadata for searchable audit logs.

Quick Start

Log an info message that a new article with ID 12345 has been published.

Frequently Asked Questions about pino-logging

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I implement structured logging in a Hono server for audit trails?

Structured logging in a Hono server is implemented by using request-scoped loggers via c.var.logger or rootLogger, automatically including request context in audit trail logs.

What is the best way to redact sensitive headers in Nodejs pino logs?

Redacting sensitive headers in pino logs is handled by enforcing automatic redaction rules within the logging configuration, prohibiting the creation of new pino instances or console statements to ensure consistent output.

How do I log security-critical audit events in Nodejs without losing request context?

Logging security-critical audit events requires including a mandatory event field in the log payload, using the request-scoped logger to automatically attach necessary request metadata for searchable audit logs.

When should I use info, warn, and error levels for structured logging in Nodejs?

Log levels for structured logging are determined by clear guidance: use info for standard operations like content publication, warn for recoverable issues, and error for failures, ensuring consistent audit trail creation.

Can I use console.log alongside pino for logging in Hono API route handlers?

Using console.log in Hono API route handlers is prohibited to prevent noisy output and missing audit trails; you must use the provided rootLogger or c.var.logger to maintain structured, request-scoped logging.