class Trashed::Railtie::ExposeLoggerTagsToRackEnv
Middleware would like to emit tagged logs after Rails::Rack::Logger pops its tags. Introduce this haxware to stash the tags in the Rack
env so we can reuse them later.
Public Class Methods
new(app)
click to toggle source
# File lib/trashed/railtie.rb, line 13 def initialize(app) @app = app end
Public Instance Methods
call(env)
click to toggle source
# File lib/trashed/railtie.rb, line 17 def call(env) @app.call(env).tap do env['trashed.logger.tags'] = Array(Thread.current[:activesupport_tagged_logging_tags]).dup end end