Sharing a request id between Apache logs and Mojolicious logs #1848
robrwo
started this conversation in
Show and tell
Replies: 1 comment
-
This is awesome. I use nginx. I'll need to investigate doing something similar for that, and your contributions should provide some great direction for how to possibly go about it. But, more importantly, thanks for sharing the idea and implementation on the discussion boards. It's really great to see discussion like this here! |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Apache has the ability to generate a unique id for each request, and include it in the logs. This request id can be saved in your Apache logs and passed to a Mojolicious application behind a reverse proxy, so that you can connect a specific request in your application logs with a request in your Apache logs.
In Apache configuration, enable
mod_unique_id
then add a custom log that includes the unique id:
In your reverse proxy configuration, add a header with the unique id:
Then update your Mojolicious application to use the request id from Apache:
Beta Was this translation helpful? Give feedback.
All reactions