use-structured-logging
Installation
SKILL.md
Summary
Adhere to Structured Logging. Output logs as machine-readable JSON, not as plain text. Ensure every log entry includes a TraceID and SpanID propagated from the request context to enable distributed tracing.
Rationale
- Machine Parseability: Log aggregation systems (Datadog, CloudWatch, ELK) can index JSON fields efficiently, allowing queries like
env:prod status:500 user_id:123. - Distributed Tracing: Without a
TraceID, it is impossible to correlate logs across multiple microservices for a single request. - Consistency: Standardized fields (
level,message,timestamp) make dashboards reliable.