class Rails::Rack::Logger

Log the request started and flush all loggers after it.

def after_dispatch(env)

def after_dispatch(env)
  ActiveSupport::LogSubscriber.flush_all!
end

def before_dispatch(env)

def before_dispatch(env)
  request = ActionDispatch::Request.new(env)
  path = request.fullpath
  info "\n\nStarted #{request.request_method} \"#{path}\" " \
       "for #{request.ip} at #{Time.now.to_default_s}"
end

def call(env)

def call(env)
  before_dispatch(env)
  @app.call(env)
ensure
  after_dispatch(env)
end

def initialize(app)

def initialize(app)
  @app = app
end