|
|
@ -30,18 +30,28 @@ Rails.configuration.after_initialize do |
|
|
|
end |
|
|
|
|
|
|
|
else |
|
|
|
time_format = '%H:%M:%S' unless Rails.application.procfile_server? |
|
|
|
SemanticLogger.clear_appenders! |
|
|
|
SemanticLogger.add_appender( |
|
|
|
io: $stdout, |
|
|
|
formatter: Rails.application.config.x.semantic.formatter.constantize.new(time_format:) |
|
|
|
formatter: Rails.application.config.x.semantic.formatter.constantize.new( |
|
|
|
time_format: Rails.application.procfile_server? ? nil : '%H:%M:%S' |
|
|
|
) |
|
|
|
) |
|
|
|
|
|
|
|
ActiveSupport::Notifications.subscribe('rolling.live_constant') do |event| |
|
|
|
constants = event.payload[:changes].map { |change| change[:constant] } |
|
|
|
if constants.intersection(%w[ACTIVE_RECORD ACTION_VIEW]).any? |
|
|
|
Semantic::Instrumentalizer.activate(*build_instrumentation_config) |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
Rails.autoloaders.main.on_load('ApplicationController') do |
|
|
|
SemanticLogger.clear_appenders! |
|
|
|
SemanticLogger.add_appender( |
|
|
|
io: $stdout, |
|
|
|
formatter: Rails.application.config.x.semantic.formatter.constantize.new(time_format:) |
|
|
|
formatter: Rails.application.config.x.semantic.formatter.constantize.new( |
|
|
|
time_format: Rails.application.procfile_server? ? nil : '%H:%M:%S' |
|
|
|
) |
|
|
|
) |
|
|
|
|
|
|
|
Rails.logger.info ' ', dimensions: Semantic::FancyDimensions.new(rails: '╔═╗', before: 1) |
|
|
@ -50,11 +60,6 @@ Rails.configuration.after_initialize do |
|
|
|
|
|
|
|
Semantic::Instrumentalizer.activate(*build_instrumentation_config) |
|
|
|
end |
|
|
|
ActiveSupport::Notifications.subscribe('rolling.live_constant') do |event| |
|
|
|
constants = event.payload[:changes].map { |change| change[:constant] } |
|
|
|
if constants.intersection(%w[ACTIVE_RECORD ACTION_VIEW]).any? |
|
|
|
Semantic::Instrumentalizer.activate(*build_instrumentation_config) |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
end |
|
|
|
end |