logging-guidelines

Enforce structured, wide-event JSON logging with Pino across services.

Updated Feb 7, 2026
One-click install
npx skills add https://github.com/loagma/LoagmaPMS --skill logging-guidelines-loagma
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: logging-guidelines
Source: https://github.com/loagma/LoagmaPMS/tree/main/.claude/skills/logging-guidelines
Command: npx skills add https://github.com/loagma/LoagmaPMS --skill logging-guidelines-loagma

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Logs are often inconsistent, hard to query, and miss critical context across services. This Skill defines a standardized approach to structured, wide-event logging using Pino, enabling unified observability and faster incident response.

Core Features & Use Cases

  • Enforces error-first logging and 100% visibility for failures.
  • Adopts the wide events pattern: one richly-detailed log per request with high-cardinality identifiers.
  • Includes snake_case field naming, PII redaction, and correlation context (trace_id, span_id, correlation_id).
  • Guides tail sampling and structured JSON logging to reduce log noise while preserving critical signals.
  • Use cases: when writing logging code, reviewing logs, implementing error handling, or when the user mentions logging, errors, or observability.

Quick Start

Configure your services to emit a single, richly-detailed log per request using Pino, ensuring error-first logging, proper redaction, and sampling where appropriate.

Frequently Asked Questions about logging-guidelines

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

FAQPage Schema
What is wide-event logging and how does it help with observability?

Structured logging formats data as JSON with consistent fields like trace_id, span_id, and correlation_id. This standardization captures full request context across services, enabling unified observability and faster incident response compared to plain text logs.

How do I configure Pino for structured JSON logs with trace IDs?

Configure Pino to emit a single, richly-detailed log per request ensuring error-first logging, snake_case field naming, and proper PII redaction. Include trace_id, span_id, and correlation_id to capture full request context for efficient debugging and incident response.

Does this structured logging approach work for microservices?

Yes, apply this standardized structured logging across services to capture full request context and high-cardinality identifiers. It enforces 100% visibility for failures and includes correlation context like trace_id and span_id for unified observability.

What's the best way to reduce log noise while preserving error signals?

Apply tail sampling to reduce log noise while preserving critical signals. Combine this with error-first logging to enforce 100% visibility for failures, ensuring structured JSON logs capture full request context without overwhelming your observability platform.

Why do I need to include trace_id and correlation_id in my logs?

Including trace_id, span_id, and correlation_id in logs captures full request context across services. This correlation context enables unified observability and efficient debugging by linking related log entries across distributed systems during incident response.

When should I apply tail sampling in my logging pipeline?

Apply tail sampling when you need to reduce log noise while preserving critical signals. Combine it with structured JSON logging and error-first visibility to ensure failures and full request context are captured without overwhelming your observability platform.