Agent skill · operations · aiskillstore

structured-logging

Guide for writing effective log messages using wide events / canonical log lines. Use when writing logging code, adding instrumentation, improving observability, or reviewing log statements. Teaches high-cardinality, high-dimensionality structured logging that enables debugging.

Why this skill is useful

Teaches structured logging patterns and high-cardinality fields that improve observability and debugging, which the AI wouldn't reliably generate on its own.

What it needs

About 3k tokens when loaded. Last updated 2026-08-07. 405 stars on the source repository.

What this skill does

Structured Logging Core Principle Emit one wide event per request per service, not scattered log statements. Build context throughout the request lifecycle Emit once at the end (in a finally block) Optimize for querying, not writing Include high-cardinality fields (userid, requestid) that enable debugging Include high-dimensionality (50+ fields) capturing full context Anti-patterns Avoid these common mistakes: Wide Event Structure One comprehensive event per request: For the comprehensive field reference, see references/wide-event-fields.md. Log Levels Use log levels to indicate severity and required action: Level When to Use Examples ------- ------------- ---------- ERROR Request failed, needs investigation Unhandled exception, 5xx response, data corruption WARN Degraded but recovered Retry succeeded, fallback used, rate limit approaching, deprecated API called INFO Normal request completion The canonical log line for successful requests DEBUG Detailed diagnostics Cache lookups, query plans, intermediate state (usually sampled out in production) The wide event's level field reflects the worst outcome of the request: Request succeeded normally: info Request succeeded after retry/fallback: warn Request failed: error Examples Bad: Scattered Logs Good: Single Wide Event Bad: Missing Context Good: Full Context Implementation Pattern Build the event throughout the request, emit once at the end: In handlers, enrich with business context: Querying Power Wide events enable queries that scattered logs cannot:

How to use it

Reference it in AdaL, Claude Code, Cursor or any coding agent — nothing to install:

@skills aiskillstore/structured-logging

View the source on GitHub

Browse the @skills marketplace