From b67e260cd58f78596e6145727593fa47705b503f Mon Sep 17 00:00:00 2001 From: Fernando Tapia Rico Date: Wed, 11 May 2016 01:01:27 +0200 Subject: Fix DB runtimes on production log Rails default production configuration establishes "info" as log level. Due to the changes included on commit 191facc857bb4fb52078fb544c6bc1613a81cc80, db runtimes were not being collected if the log level was different than "debug", and 0.0 ms was the runtime reported on production logs. --- activerecord/lib/active_record/log_subscriber.rb | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'activerecord/lib/active_record/log_subscriber.rb') diff --git a/activerecord/lib/active_record/log_subscriber.rb b/activerecord/lib/active_record/log_subscriber.rb index efa2a4df02..3fa36d8101 100644 --- a/activerecord/lib/active_record/log_subscriber.rb +++ b/activerecord/lib/active_record/log_subscriber.rb @@ -31,9 +31,8 @@ module ActiveRecord end def sql(event) - return unless logger.debug? - self.class.runtime += event.duration + return unless logger.debug? payload = event.payload -- cgit v1.2.3