Class: Rails::Rack::Logger

Inherits:
Object
  • Object
show all
Defined in:
lib/logstasher/rails_ext/rack/logger.rb

Overview

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…

Instance Method Summary collapse

Instance Method Details

#before_dispatch(env) ⇒ Object

Overwrites Rails 3.0/3.1 code that logs new requests



22
# File 'lib/logstasher/rails_ext/rack/logger.rb', line 22

def before_dispatch(env); end

#call_app(*args) ⇒ Object

Overwrites Rails 3.2 code that logs new requests



14
15
16
17
18
19
# File 'lib/logstasher/rails_ext/rack/logger.rb', line 14

def call_app(*args)
  env = args.last
  @app.call(env)
ensure
  ActiveSupport::LogSubscriber.flush_all!
end