Class: ElasticRecord::LogSubscriber

Inherits:
ActiveSupport::LogSubscriber
  • Object
show all
Defined in:
lib/elastic_record/log_subscriber.rb

Instance Method Summary collapse

Instance Method Details

#request(event) ⇒ Object



3
4
5
6
7
# File 'lib/elastic_record/log_subscriber.rb', line 3

def request(event)
  response = event.payload[:response]
  info "#{event.payload[:method].to_s.upcase} #{event.payload[:request_uri]} (%.1fms)" % [event.duration] 
  # info "--> %d %s %d (%.1fms)" % [response.code, response.message, response.body.to_s.length, event.duration]
end