aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/notifications.rb
blob: a5ce7ac524f189607db0425cc715627e24ca6e4f (plain) (blame)
1
2
3
4
5
require 'active_support/notifications'

ActiveSupport::Notifications.subscribe("sql") do |event|
  ActiveRecord::Base.connection.log_info(event.payload[:sql], event.payload[:name], event.duration)
end