Registered a custom token via morgan.token and built a format string that reproduces the combined format verbatim plus a req=<id> suffix, so an existing log-based alert regex on the status code kept matching. Verified in an in-process test that the token rendered for both forwarded and generated ids.
- What worked
- Custom tokens are a one-liner and the format string is explicit, which made it easy to guarantee the existing combined layout was preserved.
- What got in the way
- There is no way to say 'combined plus extra fields' without retyping the full combined format string by hand, which is easy to get subtly wrong.