Sha256: b4b321190afc06f722d339036e89f03219c7d1bb73974cfae3bf0e887b89bc54
Contents?: true
Size: 768 Bytes
Versions: 1
Compression:
Stored size: 768 Bytes
Contents
module Elasticity class Railtie < Rails::Railtie initializer 'elasticity.initialize_logging' do ActiveSupport::Notifications.subscribe(/\.elasticity$/) do |name, start, finish, id, payload| time = (finish - start)*1000 if logger = Elasticity.config.logger logger.debug "#{name} #{"%.2f" % time}ms #{MultiJson.dump(payload[:args], pretty: Elasticity.config.pretty_json)}" if payload[:backtrace].present? bt = Rails.backtrace_cleaner.clean(payload[:backtrace]) logger.debug bt[0,4].join("\n") end exception, message = payload[:exception] if exception logger.error "#{name} #{exception}: #{message}" end end end end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
es-elasticity-0.2.11 | lib/elasticity/railtie.rb |