logging-best-practices

Installation
SKILL.md

This skill is adpated from "Logging sucks. And here's how to make it better. by Boris Tane.

When helping with logging, observability, or debugging strategies, follow these principles:

Core Philosophy

  • Logs are optimized for querying, not writing — always design with debugging in mind
  • Context is everything — a log without correlation IDs is useless in distributed systems
  • Logs are for humans during incidents, not just for compliance or "just in case"
  • If you can't filter and search your logs effectively, they provide zero value

Structured Logging Requirements

  • Always use key-value pairs (JSON) instead of string interpolation
  • Bad: "Payment failed for user 123"
  • Good: {"event": "payment_failed", "user_id": "123", "reason": "insufficient_funds", "amount": 99.99}
  • Structured logs are machine-parseable, enabling aggregation, alerting, and dashboards

Required Fields for Every Log Event

Related skills

More from nbbaier/agent-skills

Installs
11
GitHub Stars
9
First Seen
Jan 30, 2026