edx/edx-tim — pull request #50 by jrbl (2014-02-26 19:02:28+00:00)
Title: TIM-94: Request-level logging ID

* Introduces two pieces of middleware, GlobalRequest, which creates a
hook for code anywhere in the Django stack to be able to retrieve the
request object, and SetRequestLogID, which sets a UUID on every
request object to make log threading easier.
* UUID is stored in request's META dictionary as "HTTP_X_EDX_LOG_TOKEN".
* Machinery added for forcing every ajax call to send the
x-edx-log-token header, and SetRequestLogID respects the header if it
is set. This means a parent request can be tracked through its
children, and log tags make sense across ajax events.
* Introduces log handler, RequestIDLogHandler, which retrieves the
global request object (if available) and inserts the logging request
token into the output stream. If either of the middlewares are
missing, it still works as expected, just without the log token.
* Basic log configuration added to settings/ with straightforward use of
RequestIDLogHandler.