| timestamp | ISO 8601 with timezone | 2025-01-24T20:00:00Z | | level | debug, info, warn, error | info | | event | snakecase, past tense | userloginsucceeded | | requestid or traceid | UUID or prefixed ID | reqabc123 | | service | Service/app name | api-gateway | | environment | prod, staging, dev | prod |
Include these when available — they make logs queryable during incidents:
| Identity | userid, orgid, accountid | | Tracing | requestid, traceid, spanid | | Domain | orderid, transactionid, jobid |
Production logging patterns for observability and incident debugging. Structured JSON logging, correlation IDs, context propagation, log levels, and performance. Use when implementing logging, adding observability, or debugging production systems. Triggers on logging setup, logger configuration, observability, distributed tracing, or incident response workflows. Source: majesticlabs-dev/majestic-marketplace.