Module: Contrast::Logger::Request

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

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.



18
19
20
21
22
# File 'lib/contrast/logger/request.rb', line 18

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



12
13
14
# File 'lib/contrast/logger/request.rb', line 12

def request_start
  debug('Beginning request analysis')
end