Error Context Policy
Purpose
Standardize backend error log context fields so incidents can be filtered and triaged quickly in Cloudflare and LGTM dashboards.
Required Fields
requestIdpathmethodstatuscode
Conditional Domain Fields
paymentId: when request path includes payment identifier (/api/v1/payments/status/:id)customerId: when request path includes customer identifier (/api/v1/customers/:id,/api/v1/license/customer/:id)licenseKey: when request path includes license verification key (/api/v1/license/verify/:key)
Rules
- Do not log secrets or raw tokens.
- Do not log full request bodies by default.
- Domain IDs must be logged only if extracted from trusted path parameters.
- Keep field names stable for dashboard and alert queries.
Event Names
request.errorfor handled application errors.request.error.unhandledfor uncaught errors.domain.eventfor domain transitions/outbox-aligned events.