Logging discipline: log level selection, structured fields, what to log vs what not to log, and the specific logging anti-patterns Claude defaults to. Corrects flat log levels, over-logging, string interpolation, and log-and-propagate. Use when adding logging, reviewing log output, or designing observability. Triggers: log, logging, tracing, log level, info, debug, warn, error, trace, structured logging, observability, correlation id, span, instrument.
설치
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
Logging discipline: log level selection, structured fields, what to log vs what not to log, and the specific logging anti-patterns Claude defaults to. Corrects flat log levels, over-logging, string interpolation, and log-and-propagate. Use when adding logging, reviewing log output, or designing observability. Triggers: log, logging, tracing, log level, info, debug, warn, error, trace, structured logging, observability, correlation id, span, instrument.
Logging — What Claude Gets Wrong
You log everything at info!. You log in loops. You narrate success paths at the same verbosity as failures. You use string interpolation instead of structured fields. This skill fixes all of it.
Log Level Selection
The two tests:
ERROR: "Would I wake someone up for this?" — Yes → ERROR
INFO: "Would I want this line in production at normal load?" — Yes → INFO
Level
When
Example
ERROR
Operation failed, requires attention, actionable
error!(job_id, err, "inference job failed after all retries")
WARN
Degraded but working, approaching limits, recovered failure
warn!(attempt = 3, "retry succeeded for whale_alert fetch")
INFO
State transitions, service lifecycle, business milestones