|
@ -1,11 +1,5 @@ |
|
|
return unless Rails.application.server? |
|
|
return unless Rails.application.server? |
|
|
|
|
|
|
|
|
if Rails.env.development? |
|
|
|
|
|
RailsSemanticLogger::Rack::Logger.logger.level = :info # useful for remaining log like "[Rack::Log] Started..." |
|
|
|
|
|
SemanticLogger.clear_appenders! |
|
|
|
|
|
Rails.logger.name = 'rails' |
|
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
def build_instrumentation_config |
|
|
def build_instrumentation_config |
|
|
{ |
|
|
{ |
|
|
action_controller: true, |
|
|
action_controller: true, |
|
@ -17,6 +11,12 @@ def build_instrumentation_config |
|
|
end |
|
|
end |
|
|
|
|
|
|
|
|
Rails.configuration.after_initialize do |
|
|
Rails.configuration.after_initialize do |
|
|
|
|
|
if Rails.env.development? |
|
|
|
|
|
RailsSemanticLogger::Rack::Logger.logger.level = :info # useful for remaining log like "[Rack::Log] Started..." |
|
|
|
|
|
SemanticLogger.clear_appenders! |
|
|
|
|
|
Rails.logger.name = 'rails' |
|
|
|
|
|
end |
|
|
|
|
|
|
|
|
ActiveSupport::Notifications.subscribe('rolling.live_constant') do |event| |
|
|
ActiveSupport::Notifications.subscribe('rolling.live_constant') do |event| |
|
|
constants = event.payload[:changes].map { |change| change[:constant] } |
|
|
constants = event.payload[:changes].map { |change| change[:constant] } |
|
|
if constants.intersection(%w[ACTIVE_RECORD ACTION_VIEW]).any? |
|
|
if constants.intersection(%w[ACTIVE_RECORD ACTION_VIEW]).any? |
|
|