aboutsummaryrefslogtreecommitdiffstats
path: root/railties/lib/rails/rack
diff options
context:
space:
mode:
authorAaron Patterson <aaron.patterson@gmail.com>2013-10-04 17:52:26 -0700
committerAaron Patterson <aaron.patterson@gmail.com>2013-10-04 17:52:26 -0700
commit21a71cd5d8f266252278a63316a99cc403a32cad (patch)
treeb7c177cc3f1224406ce51cfe2e49933718c9d383 /railties/lib/rails/rack
parent2ae9166d8fef242e3b0d52af0c8c79d86a80268e (diff)
downloadrails-21a71cd5d8f266252278a63316a99cc403a32cad.tar.gz
rails-21a71cd5d8f266252278a63316a99cc403a32cad.tar.bz2
rails-21a71cd5d8f266252278a63316a99cc403a32cad.zip
instrumenter can't be cached because the app could be called from
different threads.
Diffstat (limited to 'railties/lib/rails/rack')
-rw-r--r--railties/lib/rails/rack/logger.rb7
1 files changed, 4 insertions, 3 deletions
diff --git a/railties/lib/rails/rack/logger.rb b/railties/lib/rails/rack/logger.rb
index ef4cdcb080..3b35798679 100644
--- a/railties/lib/rails/rack/logger.rb
+++ b/railties/lib/rails/rack/logger.rb
@@ -11,7 +11,6 @@ module Rails
def initialize(app, taggers = nil)
@app = app
@taggers = taggers || []
- @instrumenter = ActiveSupport::Notifications.instrumenter
end
def call(env)
@@ -33,7 +32,8 @@ module Rails
logger.debug ''
end
- @instrumenter.start 'request.action_dispatch', request: request
+ instrumenter = ActiveSupport::Notifications.instrumenter
+ instrumenter.start 'request.action_dispatch', request: request
logger.info started_request_message(request)
resp = @app.call(env)
resp[2] = ::Rack::BodyProxy.new(resp[2]) { finish(request) }
@@ -70,7 +70,8 @@ module Rails
private
def finish(request)
- @instrumenter.finish 'request.action_dispatch', request: request
+ instrumenter = ActiveSupport::Notifications.instrumenter
+ instrumenter.finish 'request.action_dispatch', request: request
end
def development?