Hi all,

first a short reminder: I added logging of a request id to the mod_jk log to ease correlation with other Apache logs, like the access log. It was motivated by a discussion with Chris, although the end result wasn't exactly what he liked most.

After thinking more about the feature I changed the implementation. I'm curious, whether it works for others as well.

I tested it with Apache on Linux and with IIS.

For Apache by default it uses the ID generated by mod_unique_id (needs to be loaded). If that is loaded, Apache itself automatically uses that id in its error logs as well and one can add it to the access log, eg. via %{UNIQUE_ID}e.

One can also retrieve the request id from a custom env var configured via JkRequestIdIndicator. For example assume a request id is received via the HTTP header "X-REQUEST-ID-HEADER". Then you can configure:

JkRequestIdIndicator REQUEST-ID

and to copy the header value to this env var:

SetEnvIf X-REQUEST-ID-HEADER "(.+)" REQUEST-ID=$1

A small fix I still need to apply is falling back to the unique_id if another request id is configured but not provided for a request.

For IIS the default ID is a generated GUID. I currently know of no way how to log this in the IIS log files, but I didn't actually think long about it.

You can also get an id via a request header that you configure with "request_id_header".

You might want to experiment with it.

Probably we could release a 1.2.49 with it. Last release was more than a year ago. No hurry though.

Best regards,

Rainer

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org

Reply via email to