logging-best-practices

Standardize JSON wide-event logging with middleware and high-cardinality fields.

Updated Nov 21, 2025
One-click install
npx skills add https://github.com/NathanColosimo/kompose --skill logging-best-practices-nathancolosimo
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: logging-best-practices
Source: https://github.com/NathanColosimo/kompose/tree/main/.agents/skills/logging-best-practices
Command: npx skills add https://github.com/NathanColosimo/kompose --skill logging-best-practices-nathancolosimo

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Wide events consolidate logging into a single, context-rich event per request per service to improve debugging and analytics.

Core Features & Use Cases

  • Wide events pattern: emit a single, context-rich event per service hop
  • High cardinality and dimensionality: include user IDs, request IDs, and business context
  • Environment context: capture deployment/version/region metadata automatically
  • Single logger and middleware: ensure consistent formatting and centralized emission
  • JSON schema consistency: enforce shared field names across services

Quick Start

Configure a single logger, apply the wide-event middleware, and start emitting canonical JSON wide events for every request.

Frequently Asked Questions about logging-best-practices

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

FAQPage Schema
What are canonical log lines and how do they improve application observability?

Canonical log lines improve application observability by consolidating logging into a single, context-rich wide event per request per service, providing consistent, actionable insights for debugging and incident investigations.

How do I implement JSON logging with wide events for server-side services?

To implement JSON logging with wide events, configure a single JSON logger, apply end-to-end middleware to collect environment and request context, and emit a unified schema with high-cardinality fields for every service hop.

What's the best way to standardize logs across multiple services for incident investigations?

Standardizing logs across services requires enforcing JSON schema consistency with shared field names, using a unified logger, and relying on middleware to automatically capture deployment, version, and region metadata for every request.

Do I need middleware to collect context for high-cardinality JSON logs?

Yes, end-to-end middleware is required to collect business context, user IDs, and request IDs, ensuring that each wide event automatically contains the high-cardinality and high-dimensionality data needed for analytics.

Why use a single JSON logger instead of multiple loggers for application debugging?

Using a single JSON logger ensures consistent formatting and centralized emission of wide events, preventing fragmented logging outputs and maintaining a unified schema across all server-side services and endpoints.

When do I need high-cardinality fields in my observability logs?

High-cardinality fields are needed when your observability logs require granular filtering for debugging and analytics, allowing you to isolate specific user IDs, request IDs, and business context during incident investigations.