Module: Contrast::Logger::Request

Includes:
Components::Interface
Defined in:
lib/contrast/logger/request.rb

Overview

Our decorator for the Ougai logger allowing for the logging of the request lifecycle, used to provide context during troubleshooting.

Instance Method Summary collapse

Methods included from Components::Interface

included

Instance Method Details

#request_endObject

Utility method to log the end of a request, including the time it took for that request to be processed.



22
23
24
25
26
27
# File 'lib/contrast/logger/request.rb', line 22

def request_end
  context = Contrast::Agent::REQUEST_TRACKER.current
  elapsed_time = context ? (Contrast::Utils::Timer.now_ms - context.timer.start_ms) : -1
  debug('Ending request analysis',
        elapsed_time_ms: elapsed_time)
end

#request_startObject

Utility method to log the start of a request



16
17
18
# File 'lib/contrast/logger/request.rb', line 16

def request_start
  debug('Beginning request analysis')
end