Module: LogjamAgent::RequestHandling

Extended by:
RequestHandling
Included in:
LogjamAgent, BufferedLogger, RequestHandling
Defined in:
lib/logjam_agent/request_handling.rb

Instance Method Summary collapse

Instance Method Details

#finish_request(additional_fields = {}) ⇒ Object



20
21
22
23
24
25
26
# File 'lib/logjam_agent/request_handling.rb', line 20

def finish_request(additional_fields = {})
  if request = self.request
    request.fields.merge!(additional_fields)
    self.request = nil
    request.forward
  end
end

#requestObject



5
6
7
# File 'lib/logjam_agent/request_handling.rb', line 5

def request
  Thread.current.thread_variable_get(:logjam_request)
end

#request=(request) ⇒ Object



9
10
11
# File 'lib/logjam_agent/request_handling.rb', line 9

def request=(request)
  Thread.current.thread_variable_set(:logjam_request, request)
end

#start_request(*args) ⇒ Object



13
14
15
16
17
18
# File 'lib/logjam_agent/request_handling.rb', line 13

def start_request(*args)
  initial_fields = args.extract_options!
  app = args[0] || LogjamAgent.application_name
  env = args[1] || LogjamAgent.environment_name
  self.request = Request.new(app, env, initial_fields)
end