Skip to content
  • KJ Tsanaktsidis's avatar
    5faeb700
    Don't pop logger tags in Rails::Rack::Logger until request is finished · 5faeb700
    KJ Tsanaktsidis authored
    At the moment, Rails::Rack::Logger tags the logger (if it's
    ActiveSupport::TaggedLogging) for the duration of the @app.call, but
    only fires the request.action_dispatch event later, on body close. That
    means anything logged in request.action_dispatch handlers won't have the
    same tags as the rest of the request.
    
    Fix this by deferring the popping of tags into
    finish_request_instrumentation, in the same way that finishing the
    instrumentation handle is deferred.
    5faeb700
    Don't pop logger tags in Rails::Rack::Logger until request is finished
    KJ Tsanaktsidis authored
    At the moment, Rails::Rack::Logger tags the logger (if it's
    ActiveSupport::TaggedLogging) for the duration of the @app.call, but
    only fires the request.action_dispatch event later, on body close. That
    means anything logged in request.action_dispatch handlers won't have the
    same tags as the rest of the request.
    
    Fix this by deferring the popping of tags into
    finish_request_instrumentation, in the same way that finishing the
    instrumentation handle is deferred.
Loading