Sha256: c2c61acb4fa6cf7d8d4a1738640f3565726d3788ba2e46d289d09f9cf414782c

Contents?: true

Size: 590 Bytes

Versions: 5

Compression:

Stored size: 590 Bytes

Contents

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

5 entries across 5 versions & 1 rubygems

Version Path
logstasher-2.1.1 lib/logstasher/rails_ext/rack/logger.rb
logstasher-2.1.0 lib/logstasher/rails_ext/rack/logger.rb
logstasher-2.0.2 lib/logstasher/rails_ext/rack/logger.rb
logstasher-2.0.1 lib/logstasher/rails_ext/rack/logger.rb
logstasher-2.0.0 lib/logstasher/rails_ext/rack/logger.rb