Class: Timber::Probes::ActiveRecordLogSubscriber::LogSubscriber
- Inherits:
-
ActiveRecord::LogSubscriber
- Object
- ActiveRecord::LogSubscriber
- Timber::Probes::ActiveRecordLogSubscriber::LogSubscriber
- Defined in:
- lib/timber/probes/active_record_log_subscriber/log_subscriber.rb
Overview
The log subscriber that replaces the default ‘ActiveRecord::LogSubscriber`. The intent of this subscriber is to, as transparently as possible, properly track events that are being logged here. This LogSubscriber will never change default behavior / log messages.
Instance Method Summary collapse
-
#sql(event) ⇒ Object
:nodoc:.
Instance Method Details
#sql(event) ⇒ Object
:nodoc:
9 10 11 12 13 14 15 16 17 18 19 20 |
# File 'lib/timber/probes/active_record_log_subscriber/log_subscriber.rb', line 9 def sql(event) super(event) payload = event.payload event = Events::SQLQuery.new( sql: payload[:sql], time_ms: event.duration, message: @message ) logger.debug event end |