Sha256: 04b8d061380b46dce0be37cbb990c2c3985d34ca802ecdb1be0f318407321183

Contents?: true

Size: 1.16 KB

Versions: 114

Compression:

Stored size: 1.16 KB

Contents

# frozen_string_literal: true

Appsignal.logger.info("Loading Rails (#{Rails.version}) integration")

require "appsignal/utils/rails_helper"
require "appsignal/rack/rails_instrumentation"

module Appsignal
  module Integrations
    # @api private
    class Railtie < ::Rails::Railtie
      initializer "appsignal.configure_rails_initialization" do |app|
        Appsignal::Integrations::Railtie.initialize_appsignal(app)
      end

      def self.initialize_appsignal(app)
        # Load config
        Appsignal.config = Appsignal::Config.new(
          Rails.root,
          Rails.env,
          :name => Appsignal::Utils::RailsHelper.detected_rails_app_name,
          :log_path => Rails.root.join("log")
        )

        # Start logger
        Appsignal.start_logger

        app.middleware.insert_after(
          ActionDispatch::DebugExceptions,
          Appsignal::Rack::RailsInstrumentation
        )

        if Appsignal.config[:enable_frontend_error_catching]
          app.middleware.insert_before(
            Appsignal::Rack::RailsInstrumentation,
            Appsignal::Rack::JSExceptionCatcher
          )
        end

        Appsignal.start
      end
    end
  end
end

Version data entries

114 entries across 114 versions & 1 rubygems

Version Path
appsignal-2.11.0.alpha.2 lib/appsignal/integrations/railtie.rb
appsignal-2.11.0.alpha.2-java lib/appsignal/integrations/railtie.rb
appsignal-2.11.0.alpha.1 lib/appsignal/integrations/railtie.rb
appsignal-2.11.0.alpha.1-java lib/appsignal/integrations/railtie.rb
appsignal-2.10.9 lib/appsignal/integrations/railtie.rb
appsignal-2.10.9-java lib/appsignal/integrations/railtie.rb
appsignal-2.10.9.beta.1-java lib/appsignal/integrations/railtie.rb
appsignal-2.10.9.beta.1 lib/appsignal/integrations/railtie.rb
appsignal-2.10.8 lib/appsignal/integrations/railtie.rb
appsignal-2.10.8-java lib/appsignal/integrations/railtie.rb
appsignal-2.10.7-java lib/appsignal/integrations/railtie.rb
appsignal-2.10.7 lib/appsignal/integrations/railtie.rb
appsignal-2.10.6-java lib/appsignal/integrations/railtie.rb
appsignal-2.10.6 lib/appsignal/integrations/railtie.rb
appsignal-2.10.6.beta.1-java lib/appsignal/integrations/railtie.rb
appsignal-2.10.6.beta.1 lib/appsignal/integrations/railtie.rb
appsignal-2.10.5-java lib/appsignal/integrations/railtie.rb
appsignal-2.10.5 lib/appsignal/integrations/railtie.rb
appsignal-2.10.4 lib/appsignal/integrations/railtie.rb
appsignal-2.10.4-java lib/appsignal/integrations/railtie.rb