Sha256: 5efca888c7a3ebde207e79393924f3615abf3222396f118b29958a9e58907585

Contents?: true

Size: 966 Bytes

Versions: 96

Compression:

Stored size: 966 Bytes

Contents

# frozen_string_literal: true

Appsignal.logger.debug("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
        )

        Appsignal.start
      end
    end
  end
end

Version data entries

96 entries across 96 versions & 1 rubygems

Version Path
appsignal-3.3.11-java lib/appsignal/integrations/railtie.rb
appsignal-3.3.11 lib/appsignal/integrations/railtie.rb
appsignal-3.4.0-java lib/appsignal/integrations/railtie.rb
appsignal-3.4.0 lib/appsignal/integrations/railtie.rb
appsignal-3.3.10-java lib/appsignal/integrations/railtie.rb
appsignal-3.3.10 lib/appsignal/integrations/railtie.rb
appsignal-3.3.9-java lib/appsignal/integrations/railtie.rb
appsignal-3.3.9 lib/appsignal/integrations/railtie.rb
appsignal-3.3.8-java lib/appsignal/integrations/railtie.rb
appsignal-3.3.8 lib/appsignal/integrations/railtie.rb
appsignal-3.3.7-java lib/appsignal/integrations/railtie.rb
appsignal-3.3.7 lib/appsignal/integrations/railtie.rb
appsignal-3.3.6-java lib/appsignal/integrations/railtie.rb
appsignal-3.3.6 lib/appsignal/integrations/railtie.rb
appsignal-3.3.5-java lib/appsignal/integrations/railtie.rb
appsignal-3.3.5 lib/appsignal/integrations/railtie.rb
appsignal-3.3.4-java lib/appsignal/integrations/railtie.rb
appsignal-3.3.4 lib/appsignal/integrations/railtie.rb
appsignal-3.3.3-java lib/appsignal/integrations/railtie.rb
appsignal-3.3.3 lib/appsignal/integrations/railtie.rb