REST logging: http header vs query parameter

Posted by bronco on 25-Nov-2014 02:24

Hi, 

I'm trying to implement end-to-end logging and for that have an request id. From a (REST) server perspective this means logging in both the tomcat access log and the appserver log. Since I control both ends it's no problem to let the "client" incorporate this request id in its call.

My first thought this requestId would be best implemented as HTTP header, the transport layer is ideal for this kind of stuff. However, these header values are not available in a generic way in OpenEdge. In other words, I have to make a separate parameter mapping for each URL. Not what I want. It should be transparent somehow.

The second option is at first look to add it as query parameter. I can log this on the tomcat part easily, and via Servlet Request it can be made available in OE as well. I don't mind adding the servlet request since it's generic and can serve multiple purposes. BUT, if I add a query parameter to my URL that means that every URL is unique and therefor I loose the possibility for webserver caching of (certain) requests. That's not ideal either.

So the question is, what would be a solution for this? Did I overlook something?

Thanks

ps. I'm using 11.3, but if 11.4 would be needed for a solution that would be no problem.

Posted by bronco on 25-Nov-2014 02:56

I guess I asked the question a bit too soon. Au contraire the query parameters, the HTTP headers can be passed to the receiving procedure/method without having to be specific which parameter you're looking for (so you can pass all in one parameter). So by using the transport layer (ie http headers) I can make a transparant solution for my logging requirements.

Sorry for bothering :-)

All Replies

Posted by bronco on 25-Nov-2014 02:56

I guess I asked the question a bit too soon. Au contraire the query parameters, the HTTP headers can be passed to the receiving procedure/method without having to be specific which parameter you're looking for (so you can pass all in one parameter). So by using the transport layer (ie http headers) I can make a transparant solution for my logging requirements.

Sorry for bothering :-)

This thread is closed