/polymath-observability:logging-strategyfrom polymath-observability
Define a service's logging strategy — structured JSON, level discipline, redaction, sampling for noisy paths, cost-aware retention.
Ships in polymath-observability. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Pin a logging strategy that's useful at 3am and not the company's biggest cloud bill.
Mode: analytical — judgment inside a fixed frame. Keep the output shape; every verdict cites its evidence; unknowns are marked [TBD] or [VERIFY], never filled in.
[TBD: current GB/day and $/GB], never a guessed figure.ts — RFC3339 with timezone.level — one of debug | info | warn | error.service — service name.event — short event name (snake_case).msg — human-readable.trace_id + span_id — when in a request context.Logging strategy: refund-service
Format: JSON, one event per line.
Required fields: ts, level, service, event, msg, trace_id, span_id.
Levels in prod: INFO and above. DEBUG opt-in via X-Debug header (rate-limited to oncall).
Access logs:
One per request. Fields: route, method, status, latency_ms, request_id,
user_id (when authenticated, never anonymous user_id).
Redaction at logger:
- card_number → last4 only.
- email → hashed unless explicit allow-list (e.g. support tools).
- bearer tokens → never.
Sampling:
POST /healthz access log: 1%.
Other info logs: 100%.
Errors: 100%.
Retention:
Hot search (Loki): 7 days.
Cold archive (S3): 90 days; lifecycle to Glacier after 30.
Cost target: < $250/mo/service at current traffic. Reviewed monthly.
What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub mohammadbafkar/polymath --plugin polymath-observability9 skills in this plugin
/author-monitorAuthor a Datadog monitor — query, threshold, evaluation window, no-data behavior, notification routing; pair with polymath-sre:slo-design for SLO burn-rate monitors./dashboard-snapshotCapture a Grafana dashboard snapshot for incident timelines + postmortem evidence — snapshot URL, time range pinned, variables resolved./log-searchRun a typed, time-bounded log search against Elasticsearch — refuses unbounded scans, aggregates by trace id / status / route, returns a short evidence packet.Other plugins' skills for the same job