Sha256: 38bee34f17a9db08bd4f8ffab466ea557c99be4683dd7d75cfec966d6e3249c7

Contents?: true

Size: 610 Bytes

Versions: 24

Compression:

Stored size: 610 Bytes

Contents

module Elastics
  module Rails
    class Logger < Elastics::Logger

      attr_accessor :log_to_rails_logger, :log_to_stderr

      def initialize(*)
        super
        self.formatter = proc do |severity, datetime, progname, msg|
          elastics_formatted = elastics_format(severity, msg)
          ::Rails.logger.send(severity.downcase.to_sym, elastics_formatted) if log_to_rails_logger && ::Rails.logger.respond_to?(severity.downcase.to_sym)
          elastics_formatted if log_to_stderr
        end
        @log_to_rails_logger = true
        @log_to_stderr       = false
      end

    end
  end
end

Version data entries

24 entries across 24 versions & 1 rubygems

Version Path
elastics-rails-1.3.3 lib/elastics/rails/logger.rb
elastics-rails-1.3.2 lib/elastics/rails/logger.rb
elastics-rails-1.3.1 lib/elastics/rails/logger.rb
elastics-rails-1.3.0 lib/elastics/rails/logger.rb
elastics-rails-1.2.1 lib/elastics/rails/logger.rb
elastics-rails-1.2.0 lib/elastics/rails/logger.rb
elastics-rails-1.1.11 lib/elastics/rails/logger.rb
elastics-rails-1.1.10 lib/elastics/rails/logger.rb
elastics-rails-1.1.9 lib/elastics/rails/logger.rb
elastics-rails-1.1.8 lib/elastics/rails/logger.rb
elastics-rails-1.1.7 lib/elastics/rails/logger.rb
elastics-rails-1.1.6 lib/elastics/rails/logger.rb
elastics-rails-1.1.5 lib/elastics/rails/logger.rb
elastics-rails-1.1.4 lib/elastics/rails/logger.rb
elastics-rails-1.1.3 lib/elastics/rails/logger.rb
elastics-rails-1.1.2 lib/elastics/rails/logger.rb
elastics-rails-1.1.1 lib/elastics/rails/logger.rb
elastics-rails-1.1.0 lib/elastics/rails/logger.rb
elastics-rails-1.0.10 lib/elastics/rails/logger.rb
elastics-rails-1.0.9 lib/elastics/rails/logger.rb