13558: Merge branch 'master' into wtsi-hgi-13558-debug-log-tag-req-id
authorTom Clegg <tclegg@veritasgenetics.com>
Thu, 9 Aug 2018 19:06:28 +0000 (15:06 -0400)
committerTom Clegg <tclegg@veritasgenetics.com>
Thu, 9 Aug 2018 19:06:28 +0000 (15:06 -0400)
Arvados-DCO-1.1-Signed-off-by: Tom Clegg <tclegg@veritasgenetics.com>

services/api/app/controllers/application_controller.rb

index ba7c07d27266f26ef3bcdbcfc01940d406cec9b1..71176056fa3f24c5340796d2ef2fe20069acd666 100644 (file)
@@ -382,7 +382,9 @@ class ApplicationController < ActionController::Base
       req_id = "req-" + Random::DEFAULT.rand(2**128).to_s(36)[0..19]
     end
     response.headers['X-Request-Id'] = Thread.current[:request_id] = req_id
-    yield
+    Rails.logger.tagged(req_id) do
+      yield
+    end
     Thread.current[:request_id] = nil
   end