Merge "[placement] reorder middleware to correct logging context"
This commit is contained in:
@@ -49,12 +49,20 @@ def deploy(conf, project_name):
|
|||||||
|
|
||||||
application = handler.PlacementHandler()
|
application = handler.PlacementHandler()
|
||||||
|
|
||||||
for middleware in (context_middleware,
|
# NOTE(cdent): The ordering here is important. The list is ordered
|
||||||
auth_middleware,
|
# from the inside out. For a single request req_id_middleware is called
|
||||||
microversion_middleware,
|
# first and microversion_middleware last. Then the request is finally
|
||||||
|
# passed to the application (the PlacementHandler). At that point
|
||||||
|
# the response ascends the middleware in the reverse of the
|
||||||
|
# order the request went in. This order ensures that log messages
|
||||||
|
# all see the same contextual information including request id and
|
||||||
|
# authentication information.
|
||||||
|
for middleware in (microversion_middleware,
|
||||||
fault_wrap,
|
fault_wrap,
|
||||||
req_id_middleware,
|
|
||||||
request_log,
|
request_log,
|
||||||
|
context_middleware,
|
||||||
|
auth_middleware,
|
||||||
|
req_id_middleware,
|
||||||
):
|
):
|
||||||
application = middleware(application)
|
application = middleware(application)
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user