Write structured log statements at the right level, with enough context to diagnose a problem and no PII or secrets. Use whenever adding or reviewing logging calls, choosing a log level, or deciding what to include in a log message.
Installation
Install with Codex or Claude Copy this prompt, paste it into Codex, Claude, or another assistant, and let it review the skill page and install it for you.
Write structured log statements at the right level, with enough context to diagnose a problem and no PII or secrets. Use whenever adding or reviewing logging calls, choosing a log level, or deciding what to include in a log message.
Structured Logging
Rules
Use structured logging — key-value pairs or structured objects, never concatenated strings.
Log at service/system boundaries (requests, outgoing calls, significant state transitions).
Log enough context to diagnose a problem without reproducing it — include relevant identifiers and state.
Never log PII (names, emails, phone numbers, IP addresses, or anything that identifies an individual).
Never log secrets, credentials, tokens, or passwords.
Avoid logging large payloads in full — summarise or truncate.
Log Levels
Level
Use when
Error
Unexpected failure; operation could not complete
Warning
Unexpected but recoverable; may need investigation