You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

18 lines
580 B

  1. RailsSemanticLogger::Rack::Logger.logger.level = :info # useful for remaining log like "[Rack::Log] Started..."
  2. SemanticLogger.clear_appenders!
  3. im = nil
  4. # Zeitwerk reload message
  5. Rails.autoloaders.main.on_load('ApplicationController') do
  6. SemanticLogger[:zeitwerk].debug('reload!')
  7. im = Semantic::InstrumentationManager.new
  8. end
  9. Rails.configuration.after_initialize do
  10. Semantic::InstrumentationManager.clear
  11. ActiveSupport::Notifications.subscribe('rolling.live_constant') do |event|
  12. im.process(event.payload[:changes])
  13. rescue StandardError => e
  14. puts e
  15. end
  16. end