You are here

Send request or session IDs to back-end system

Introduction

Airlock has a mechanism called "Environment Cookies", which is used to send information about the request to back-end servers. There is another mechanism to assign unique request IDs to http requests handled by Airlock.

Airlock is able to propagate this request ID via the Environment Cookies to the back-end server in order to log the request of the back-end server and get a correlation to the original request of the external client.

One could also think of reusing this ID in the back-end application itself and use it to identify a database transaction. This would mean there is one consistent request ID across all layers (from the entry point to the back-end server and even on the database layer), allowing to link every transaction to a HTTP request and vice versa.

Information that might be of interest is:

  • request ID
  • session ID
  • original client IP address

Example with Apache 2.x:

To log the request ID in apache simply follow those steps :

  1. Enable Environment Cookies in the mapping.
  2. Create a new log format in the apache httpd.conf and refer to it LogFormat "%v %h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \
    \"%{User-Agent}i\" rid:%{AL_ENV_REQUEST_ID}C" airlock_combined
    CustomLog /var/log/apache/access_log airlock_combined
  3. Restart the back-end apache server and activate Airlock to make changes active

You can find all defined Environment Cookies in the Airlock online manual on the Back-end Control API page. Make sure your environment cookie prefix AL_ENV matches the one you have defined in your Airlock cookie settings.

If you want to see the original client IP address in the logs use '%{AL_ENV_REMOTE_ADDR}C' instead of '%h' in the logformat

This guide covers only Apache 2.x , but it should also be possible for other web servers (e.g. IIS), if they allow you to define your own log format and using data from request cookies.

Knowledge Base Categories: