Sha256: a98266eeeaf78353660af4384be6dd98df3a1044ee40f24808a0c6673da8c4fd

Contents?: true

Size: 940 Bytes

Versions: 15

Compression:

Stored size: 940 Bytes

Contents

module Timber
  module Frameworks
    # Module for Rails specific code, such as the Railtie and any methods that assist
    # with Rails setup.
    module Rails
      # Installs Timber into your Rails app automatically.
      class Railtie < ::Rails::Railtie
        config.timber = Config.instance

        config.before_initialize do
          Timber::Config.instance.logger = Proc.new { ::Rails.logger }
        end

        # Must be loaded after initializers so that we respect any Timber configuration set
        initializer(:timber, before: :build_middleware_stack, after: :load_config_initializers) do
          Integrations.integrate!

          # Install the Rack middlewares so that we capture structured data instead of
          # raw text logs.
          Integrations::Rack.middlewares.collect do |middleware_class|
            config.app_middleware.use middleware_class
          end
        end
      end
    end
  end
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
timber-2.6.2 lib/timber/frameworks/rails.rb
timber-2.6.1 lib/timber/frameworks/rails.rb
timber-2.6.0 lib/timber/frameworks/rails.rb
timber-2.6.0.pre.beta2 lib/timber/frameworks/rails.rb
timber-2.6.0.pre.beta1 lib/timber/frameworks/rails.rb
timber-2.5.1 lib/timber/frameworks/rails.rb
timber-2.5.0 lib/timber/frameworks/rails.rb
timber-2.4.0 lib/timber/frameworks/rails.rb
timber-2.3.4 lib/timber/frameworks/rails.rb
timber-2.3.3 lib/timber/frameworks/rails.rb
timber-2.3.2 lib/timber/frameworks/rails.rb
timber-2.3.1 lib/timber/frameworks/rails.rb
timber-2.3.0 lib/timber/frameworks/rails.rb
timber-2.2.3 lib/timber/frameworks/rails.rb
timber-2.2.2 lib/timber/frameworks/rails.rb