Sha256: 9104ee0e7483b3cd4b067ad48e15fd7eea7b9ff7cff958cb759a847a82c91368

Contents?: true

Size: 1.08 KB

Versions: 15

Compression:

Stored size: 1.08 KB

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

        after =
          begin
            require 'devise'
            'devise.omniauth'
          rescue LoadError
            :load_config_initializers
          end

        # Must be loaded after initializers so that we respect any Timber configuration
        # set
        initializer(:timber, before: :build_middleware_stack, after: after) 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.2.1 lib/timber/frameworks/rails.rb
timber-2.2.0 lib/timber/frameworks/rails.rb
timber-2.1.10 lib/timber/frameworks/rails.rb
timber-2.1.9 lib/timber/frameworks/rails.rb
timber-2.1.8 lib/timber/frameworks/rails.rb
timber-2.1.7 lib/timber/frameworks/rails.rb
timber-2.1.6 lib/timber/frameworks/rails.rb
timber-2.1.5 lib/timber/frameworks/rails.rb
timber-2.1.4 lib/timber/frameworks/rails.rb
timber-2.1.3 lib/timber/frameworks/rails.rb
timber-2.1.2 lib/timber/frameworks/rails.rb
timber-2.1.1 lib/timber/frameworks/rails.rb
timber-2.1.0 lib/timber/frameworks/rails.rb
timber-2.1.0.rc6 lib/timber/frameworks/rails.rb
timber-2.1.0.rc5 lib/timber/frameworks/rails.rb