Class: Logister::RequestSubscriber

Inherits:
Object
  • Object
show all
Defined in:
lib/logister/request_subscriber.rb

Constant Summary collapse

IGNORED_SQL_NAMES =
%w[SCHEMA TRANSACTION].freeze

Class Method Summary collapse

Class Method Details

.install!Object



8
9
10
11
12
13
14
15
16
17
18
19
20
# File 'lib/logister/request_subscriber.rb', line 8

def install!
  return if @installed

  ActiveSupport::Notifications.subscribe("process_action.action_controller") do |_name, _started, _finished, _id, payload|
    handle_process_action(payload)
  end

  ActiveSupport::Notifications.subscribe("sql.active_record") do |_name, started, finished, _id, payload|
    handle_sql_breadcrumb(started, finished, payload)
  end

  @installed = true
end