Class: Airfoil::Middleware::LoggerTagging

Inherits:
Base
  • Object
show all
Defined in:
lib/airfoil/middleware/logger_tagging.rb

Instance Method Summary collapse

Constructor Details

#initialize(app, logger) ⇒ LoggerTagging

Returns a new instance of LoggerTagging.



6
7
8
9
# File 'lib/airfoil/middleware/logger_tagging.rb', line 6

def initialize(app, logger)
  super(app)
  @logger = logger
end

Instance Method Details

#call(env) ⇒ Object



11
12
13
14
15
16
# File 'lib/airfoil/middleware/logger_tagging.rb', line 11

def call(env)
  context = env[:context]
  @logger.tagged(ENV["_X_AMZN_TRACE_ID"], context.aws_request_id) do
    @app.call(env)
  end
end