Sha256: 45a19ade42d7db14a767147495cdc478b9847055441e0c020ee3edc741e86e46
Contents?: true
Size: 471 Bytes
Versions: 8
Compression:
Stored size: 471 Bytes
Contents
module Rack class XIDLogging def initialize(app, root_logger, header_name = 'XID', &block) @root_logger = root_logger @header_name = header_name @app = app end def call(env) begin xid = env["HTTP_#{@header_name.upcase.tr('-', '_')}"] if xid env['xid'] = {@header_name => xid} @root_logger.with_meta_context(xid: xid) do return @app.call(env) end else return @app.call(env) end ensure end end end end
Version data entries
8 entries across 8 versions & 1 rubygems