Sha256: 5da4dbbe3722a69554c927e0db183e72f875c226b43191d56830616a4b292f24

Contents?: true

Size: 629 Bytes

Versions: 29

Compression:

Stored size: 629 Bytes

Contents

require 'active_support/concern'
require 'rails/rack/logger'

module Rails
  module Rack
    # Overwrites defaults of Rails::Rack::Logger that cause
    # unnecessary logging.
    # This effectively removes the log lines from the log
    # that say:
    # Started GET / for 192.168.2.1...
    class Logger
      # Overwrites Rails 3.2 code that logs new requests
      def call_app(*args)
        env = args.last
        @app.call(env)
      ensure
        ActiveSupport::LogSubscriber.flush_all!
      end

      # Overwrites Rails 3.0/3.1 code that logs new requests
      def before_dispatch(_env)
      end
    end
  end
end

Version data entries

29 entries across 29 versions & 3 rubygems

Version Path
lograge-0.11.2 lib/lograge/rails_ext/rack/logger.rb
lograge-0.11.1 lib/lograge/rails_ext/rack/logger.rb
lograge-0.11.0 lib/lograge/rails_ext/rack/logger.rb
lograge-0.10.0 lib/lograge/rails_ext/rack/logger.rb
lograge-0.9.0 lib/lograge/rails_ext/rack/logger.rb
lograge-0.8.0 lib/lograge/rails_ext/rack/logger.rb
lograge-0.7.1 lib/lograge/rails_ext/rack/logger.rb
lograge-0.7.0 lib/lograge/rails_ext/rack/logger.rb
lograge-0.6.0 lib/lograge/rails_ext/rack/logger.rb
lograge-0.5.1 lib/lograge/rails_ext/rack/logger.rb
lograge-0.5.0 lib/lograge/rails_ext/rack/logger.rb
lograge-0.5.0.rc2 lib/lograge/rails_ext/rack/logger.rb
lograge-0.5.0.rc1 lib/lograge/rails_ext/rack/logger.rb
kenny-0.1.2 lib/kenny/rails_ext/rack/logger.rb
kenny-0.1.1 lib/kenny/rails_ext/rack/logger.rb
lograge-0.4.1 lib/lograge/rails_ext/rack/logger.rb
lograge-0.4.0 lib/lograge/rails_ext/rack/logger.rb
lograge-0.4.0.rc2 lib/lograge/rails_ext/rack/logger.rb
lograge-0.4.0.rc1 lib/lograge/rails_ext/rack/logger.rb
lograge-0.4.0.pre4 lib/lograge/rails_ext/rack/logger.rb