Sha256: 16986af5988c2e90403fd2c6fdc85869a3a304df584f61b500fb1714d70e514b

Contents?: true

Size: 782 Bytes

Versions: 42

Compression:

Stored size: 782 Bytes

Contents

require 'rollbar'

module Rollbar
  module Rails
    def self.initialize
      rails_logger = if defined?(::Rails.logger)
                       ::Rails.logger
                     elsif defined?(RAILS_DEFAULT_LOGGER)
                       RAILS_DEFAULT_LOGGER
                     end

      Rollbar.preconfigure do |config|
        config.logger = rails_logger
        config.environment = defined?(::Rails.env) && ::Rails.env || defined?(RAILS_ENV) && RAILS_ENV
        config.root = defined?(::Rails.root) && ::Rails.root || defined?(RAILS_ROOT) && RAILS_ROOT
        config.framework = defined?(::Rails.version) && "Rails: #{::Rails.version}" || defined?(::Rails::VERSION::STRING) && "Rails: #{::Rails::VERSION::STRING}"
      end
    end
  end
end

Rollbar::Rails.initialize

Version data entries

42 entries across 42 versions & 1 rubygems

Version Path
rollbar-2.3.0 lib/rollbar/rails.rb
rollbar-2.2.1 lib/rollbar/rails.rb
rollbar-2.2.0 lib/rollbar/rails.rb
rollbar-2.1.2 lib/rollbar/rails.rb
rollbar-2.1.1 lib/rollbar/rails.rb
rollbar-2.1.0 lib/rollbar/rails.rb
rollbar-2.0.2 lib/rollbar/rails.rb
rollbar-2.0.1 lib/rollbar/rails.rb
rollbar-2.0.0 lib/rollbar/rails.rb
rollbar-1.5.3 lib/rollbar/rails.rb
rollbar-1.5.2 lib/rollbar/rails.rb
rollbar-1.5.1 lib/rollbar/rails.rb
rollbar-1.5.0 lib/rollbar/rails.rb
rollbar-1.4.5 lib/rollbar/rails.rb
rollbar-1.4.4 lib/rollbar/rails.rb
rollbar-1.4.3 lib/rollbar/rails.rb
rollbar-1.4.2 lib/rollbar/rails.rb
rollbar-1.4.1 lib/rollbar/rails.rb
rollbar-1.4.0 lib/rollbar/rails.rb
rollbar-1.3.2 lib/rollbar/rails.rb