Katello/katello — pull request #2343 by pitr-ch (2013-05-21 09:36:27+00:00)
Title: fix log correlation by request uuid

Uuid correlation was set too late. It was showing wrong uuid for log
messages when uuid is being logged and level is set to :debug.

Uuid is now set in middleware right after request uuid determination
before any logging occurs.

It changed uuid in the middle of logging

[ INFO 2013-05-21 10:12:30 app f8a67bdf7d72191540b8cc8feff34f8d #77151] Started GET "/katello//api/repositories/157/distributions" for 127.0.0.1 at 2013-05-21 10:12:30 +0200
[ INFO 2013-05-21 10:12:30 app f8a67bdf7d72191540b8cc8feff34f8d #77151] Processing by Api::V1::DistributionsController#index as JSON
[ INFO 2013-05-21 10:12:30 app f8a67bdf7d72191540b8cc8feff34f8d #77151] Parameters: {"repository_id"=>"157"}
[DEBUG 2013-05-21 10:12:30 app f8a67bdf7d72191540b8cc8feff34f8d #77151] Setting locale: en
[DEBUG 2013-05-21 10:12:30 app f8a67bdf7d72191540b8cc8feff34f8d #77151] Warden is authenticating admin against database
[DEBUG 2013-05-21 10:12:30 app f8a67bdf7d72191540b8cc8feff34f8d #77151] User admin authenticated: database
[DEBUG 2013-05-21 10:12:30 app 2626589640febaac7390e9ba596f3b07 #77151] Setting current user thread-local variable to admin
[DEBUG 2013-05-21 10:12:30 app 2626589640febaac7390e9ba596f3b07 #77151] Checking params for api/v1/distributions/index
[DEBUG 2013-05-21 10:12:30 app 2626589640febaac7390e9ba596f3b07 #77151] Authorizing admin for api/v1/distributions/index
[DEBUG 2013-05-21 10:12:30 pulp_rest 2626589640febaac7390e9ba596f3b07 #77151] RestClient.post "https://192.168.25.100/pulp/api/v2/repositories/org_label_H3klffMCivk7-fewups_product_H3klffMCivk7-repo_H3klffMCivk7/search/units/", "{\"criteria\":{\"type_ids\":[\"distribution\"]}}", "Accept"=>"application/json", "Accept-Encoding"=>"gzip, deflate", "Authorization"=>"OAuth oauth_body_hash=\"2jmj7l5rSw0yVb%2FvlWAYkK%2FYBwk%3D\", oauth_consumer_key=\"katello\", oauth_nonce=\"sCSXzWWfPklS8QkBwT2j5h5xYYLizseWMFW3lGXos\", oauth_signature=\"HAVKsAOz%2FPP8aVLKFQ1pHK2WKYU%3D\", oauth_signature_method=\"HMAC-SHA1\", oauth_timestamp=\"1369123950\", oauth_version=\"1.0\"", "Content-Length"=>"42", "Content-Type"=>"application/json", "pulp-user"=>"admin"
| \n# => 200 OK | application/json 2735 bytes