app/lib/rack/spyup.rb
# Returns an access information for logging.
#
# @param [Rack::Request] req
# @param [Rack::Response] res
# @param [SleepWarm::Rule] rule
# @return [Hash]
Returns an access information for logging.
Returns an access information for logging .
def access_info(req, res, rule)
      info = {
        all: base64_encoded_request(req),
        client_ip: req.env["HTTP_X_FORWARDED_FOR"] || req.env["REMOTE_ADDR"],
        hostname: req.host_with_port,
        request_line: request_line(req),
        rule_id: rule ? rule.id : 0,
        status_code: res.status,
        type: "sleep-warm-access",
        user_agent: req.user_agent,
        version: req.env["HTTP_VERSION"],
      }
      info[:message] = "#{info[:client_ip]} #{info[:hostname]} \"#{info[:request_line]} #{info[:version]}\" #{info[:status_code]} #{info[:rule_id]}"
      info
    end
def access_info ( req , res , rule ) info = { all : base64_encoded_request ( req ) , client_ip : req . env [ "HTTP_X_FORWARDED_FOR" ] || req . env [ "REMOTE_ADDR" ] , hostname : req . host_with_port , request_line : request_line ( req ) , rule_id : rule ? rule . id : 0 , status_code : res . status , type : "sleep-warm-access" , user_agent : req . user_agent , version : req . env [ "HTTP_VERSION" ] , } info [ :message ] = "#{info[:client_ip]} #{info[:hostname]} \"#{info[:request_line]} #{info[:version]}\" #{info[:status_code]} #{info[:rule_id]}" info end
Returns an access information for logging.
Returns an access information for logging .
None
Hash
req
<not_specific>
res
<not_specific>
rule
<not_specific>
<not_specific>
None