Getting at the http response

So at least in larger production systems, you normally don't use the
rails log files that often. For example we log everything through
scribed which goes into hadoop.

While the code is fairly simple, it takes a bit of digging around to
get at the http response status code. IMO t he entire http response
should be exposed via an official interface of some kind. Ideally,
after_filters should also at least have an option of actually running
after the response is set in stone, maybe even after it's been sent to
the client.

This is what we do now to set the http status in our custom logger
when it's something other then a 200.

rescue_from Exception do |e|

Rails.logger.bi.set_http_status(Rack::Utils.status_code(ActionDispatch::ShowExceptions.rescue_responses[e.class.name]))
    Rails.logger.flush_logs
    raise
  end