Sha256: 8e5825f88cd26052753a1874d91f1244fffe8e74e2aa501f171b472e057dc1f2
Contents?: true
Size: 828 Bytes
Versions: 18
Compression:
Stored size: 828 Bytes
Contents
module Timber module Probes class ActiveRecordLogSubscriber < Probe # 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. class LogSubscriber < ::ActiveRecord::LogSubscriber #:nodoc: 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 private def debug(message) @message = message end end end end end
Version data entries
18 entries across 18 versions & 2 rubygems