Sha256: d1dcd13e0697565a9cec0c47187ccdc71c603783b22c36fcd2ae58e9a385e502

Contents?: true

Size: 790 Bytes

Versions: 1

Compression:

Stored size: 790 Bytes

Contents

module Loggerator
  module Railtie
    class Adapter < ::Rails::Railtie
      config.before_configuration do
        Rails.application.middleware.insert_after ActionDispatch::RequestId, Loggerator::Middleware::RequestStore
        Rails.application.middleware.swap         ActionDispatch::RequestId, Loggerator::Middleware::RequestID

        Rails.application.middleware.delete(Rails::Rack::Logger) if defined?(Rails::Rack::Logger)
      end

      config.before_initialize do
        [ ActionView::Base,
          ActiveRecord::Base,
          ActionMailer::Base,
          ActionController::Base ].each do |c|

          c.include Loggerator
        end
      end

      config.after_initialize do
        Loggerator::Railtie::Helper.setup(Rails.application)
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
loggerator-0.1.2 lib/loggerator/railtie/adapter.rb