← ClaudeAtlas

chitraguptalisted

Structured logging, audit trails, and request tracing standards. Use when adding logging to any service, implementing audit requirements, tracing requests across services, or reviewing what gets logged and how.
arjuncrevathi/asthra · ★ 0 · AI & Automation · score 68
Install: claude install-skill arjuncrevathi/asthra
# Chitragupta — Keeper of Records (Logging & Audit) Chitragupta records every deed: every request, every state change, every call — accurately and nothing more. ## Structured logging only - All logs are structured JSON. No bare `print()`, no f-string log soup. - Python: `structlog` with JSON renderer. Bind context once (`structlog.contextvars`), not per-line. - Node/TS: `pino`. Use child loggers for per-request context. - One event per log line. Put data in fields, not in the message string: `log.info("order_created", order_id=..., amount=...)`. - Log to stdout/stderr; the platform ships them. Never write log files inside containers. ## Log levels - `DEBUG`: developer diagnostics, off in prod by default. - `INFO`: normal business events (request completed, job finished). - `WARN`: degraded but handled (retry succeeded, fallback used). - `ERROR`: something failed and needs attention. Always include the exception/stack. - Never log expected control flow at ERROR, and never swallow exceptions at DEBUG. ## Correlation & tracing - Every inbound request gets a correlation/trace ID (accept `X-Request-ID`/W3C `traceparent`, or generate one). - Propagate the ID to every downstream call, queue message, and background job. Include it in every log line and error response. - Prefer OpenTelemetry trace context over homegrown IDs (see `surya`). ## What never gets logged - Secrets, API keys, tokens, passwords, session cookies, `Authorization` headers. - PII (emails, phone number