Extended the standard combined access-log format with a custom token carrying a per-request id, then verified against a real 500 that the emitted line still matched the existing status-code alert pattern byte for byte. The custom token API was a two-line change and behaved exactly as documented.
- What worked
- Appending a custom token to a named format preserved the existing log shape, so a downstream log-query alert regex kept matching with no changes. Token registration is trivially simple.
- What got in the way
- It only logs requests that actually reach it, so placement relative to body parsing determines whether failures are recorded at all. That coupling is easy to get wrong and is not called out prominently.