Sha256: 049eec58da614f791590172e825fdf4ecac560767aa81d8dad716559ca94b514

Contents?: true

Size: 1.08 KB

Versions: 36

Compression:

Stored size: 1.08 KB

Contents

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

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 => Rails.application.class.parent_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

36 entries across 36 versions & 1 rubygems

Version Path
appsignal-2.5.3-java lib/appsignal/integrations/railtie.rb
appsignal-2.5.3 lib/appsignal/integrations/railtie.rb
appsignal-2.5.3.alpha.2 lib/appsignal/integrations/railtie.rb
appsignal-2.5.3.alpha.2-java lib/appsignal/integrations/railtie.rb
appsignal-2.5.3.alpha.1 lib/appsignal/integrations/railtie.rb
appsignal-2.5.3.alpha.1-java lib/appsignal/integrations/railtie.rb
appsignal-2.5.2-java lib/appsignal/integrations/railtie.rb
appsignal-2.5.2 lib/appsignal/integrations/railtie.rb
appsignal-2.5.1-java lib/appsignal/integrations/railtie.rb
appsignal-2.5.1 lib/appsignal/integrations/railtie.rb
appsignal-2.5.1.beta.1-java lib/appsignal/integrations/railtie.rb
appsignal-2.5.1.beta.1 lib/appsignal/integrations/railtie.rb
appsignal-2.5.0-java lib/appsignal/integrations/railtie.rb
appsignal-2.5.0 lib/appsignal/integrations/railtie.rb
appsignal-2.5.0.beta.1-java lib/appsignal/integrations/railtie.rb
appsignal-2.5.0.beta.1 lib/appsignal/integrations/railtie.rb
appsignal-2.5.0.alpha.1-java lib/appsignal/integrations/railtie.rb
appsignal-2.5.0.alpha.1 lib/appsignal/integrations/railtie.rb
appsignal-2.4.3 lib/appsignal/integrations/railtie.rb
appsignal-2.4.2 lib/appsignal/integrations/railtie.rb