Sha256: c65a69ca69570d1f8f7582819f5fe6569d7ade3edf4334c21ce8a0dcc94cd403

Contents?: true

Size: 1.13 KB

Versions: 96

Compression:

Stored size: 1.13 KB

Contents

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

require 'appsignal/rack/rails_instrumentation'

module Appsignal
  module Integrations
    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,
          ENV.fetch('APPSIGNAL_APP_ENV', Rails.env),
          :name => Rails.application.class.parent_name,
          :log_path => Rails.root.join('log')
        )

        # Start logger
        Appsignal.start_logger

        app.middleware.insert_before(
          ActionDispatch::RemoteIp,
          Appsignal::Rack::RailsInstrumentation
        )

        if Appsignal.config.active? &&
          Appsignal.config[:enable_frontend_error_catching] == true
          app.middleware.insert_before(
            Appsignal::Rack::RailsInstrumentation,
            Appsignal::Rack::JSExceptionCatcher,
          )
        end

        Appsignal.start
      end
    end
  end
end

Version data entries

96 entries across 96 versions & 1 rubygems

Version Path
appsignal-1.1.9 lib/appsignal/integrations/railtie.rb
appsignal-1.1.9.beta.2 lib/appsignal/integrations/railtie.rb
appsignal-1.1.9.beta.1 lib/appsignal/integrations/railtie.rb
appsignal-1.1.8 lib/appsignal/integrations/railtie.rb
appsignal-1.2.0.alpha.3 lib/appsignal/integrations/railtie.rb
appsignal-1.1.7 lib/appsignal/integrations/railtie.rb
appsignal-1.2.0.alpha.2 lib/appsignal/integrations/railtie.rb
appsignal-1.1.7.beta.2 lib/appsignal/integrations/railtie.rb
appsignal-1.2.0.alpha.1 lib/appsignal/integrations/railtie.rb
appsignal-1.1.7.beta.1 lib/appsignal/integrations/railtie.rb
appsignal-1.1.6 lib/appsignal/integrations/railtie.rb
appsignal-1.1.6.beta.1 lib/appsignal/integrations/railtie.rb
appsignal-1.1.5 lib/appsignal/integrations/railtie.rb
appsignal-1.1.5.beta.4 lib/appsignal/integrations/railtie.rb
appsignal-1.1.5.beta.3 lib/appsignal/integrations/railtie.rb
appsignal-1.1.5.beta.2 lib/appsignal/integrations/railtie.rb
appsignal-1.1.5.beta.1 lib/appsignal/integrations/railtie.rb
appsignal-1.1.4 lib/appsignal/integrations/railtie.rb
appsignal-1.1.4.beta.3 lib/appsignal/integrations/railtie.rb
appsignal-1.1.4.beta.2 lib/appsignal/integrations/railtie.rb