diff options
author | José Valim <jose.valim@gmail.com> | 2009-10-07 11:17:50 -0300 |
---|---|---|
committer | José Valim <jose.valim@gmail.com> | 2009-10-15 18:18:44 -0300 |
commit | af0d1fa8920793a95fae456d1f5debdc50287eb3 (patch) | |
tree | dfae586337161abfa8567bf085bdb2e68a070cc2 /activerecord/lib/active_record/instrument.rb | |
parent | 5d0f8abc003cc6edfdb471ada05754580725b353 (diff) | |
download | rails-af0d1fa8920793a95fae456d1f5debdc50287eb3.tar.gz rails-af0d1fa8920793a95fae456d1f5debdc50287eb3.tar.bz2 rails-af0d1fa8920793a95fae456d1f5debdc50287eb3.zip |
Update Orchestra instrumentations and move part of logging to Orchestra.
Diffstat (limited to 'activerecord/lib/active_record/instrument.rb')
-rw-r--r-- | activerecord/lib/active_record/instrument.rb | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/activerecord/lib/active_record/instrument.rb b/activerecord/lib/active_record/instrument.rb new file mode 100644 index 0000000000..06d3e40080 --- /dev/null +++ b/activerecord/lib/active_record/instrument.rb @@ -0,0 +1,5 @@ +require 'active_support/orchestra' + +ActiveSupport::Orchestra.subscribe("sql") do |event| + ActiveRecord::Base.connection.log_info(event.payload[:sql], event.payload[:name], event.duration) +end |