class Logtail::Integrations::Rack::HTTPContext
A Rack
middleware that is reponsible for adding the HTTP context {Logtail::Contexts::HTTP}.
Public Instance Methods
call(env)
click to toggle source
# File lib/logtail-rack/http_context.rb, line 11 def call(env) request = Util::Request.new(env) context = Contexts::HTTP.new( host: request.host.force_encoding('UTF-8'), method: request.request_method.force_encoding('UTF-8'), path: request.path, remote_addr: request.ip.force_encoding('UTF-8'), request_id: request.request_id ) CurrentContext.add(context.to_hash) @app.call(env) end