Closed ccrvlh closed 2 years ago
Middleware are evaluated in sequence (first defined is called first on the way in, and last on the way out). If you want correlation IDs in your middleware logs, you should make sure to put this middleware first 🙂
Let me know if you have any trouble 👍
Perfect, thanks a lot! I added the (correlation-id) middleware and it works perfectly. Thanks!
Hi, I have a middleware in place that logs requests, response time, etc, something like:
After configuring the correlation id, I can see it working when using
logger.info("Route")
inside the route, but the middleware above won't log the ID. Is there a way to make it available in other middleware?Thanks a lot!