railsware/http_logger — pull request #8 by dwbutler (2014-03-19 14:17:48+00:00)
Title: Log body for GET requests

We've been using Elasticsearch in our Rails app via the Tire gem. We noticed that the request body for search API calls were not getting logged by HTTP Logger. It turns out that HTTP Logger does not log the request body for GET requests. Normally it's unusual for a GET request to have a body, but [Elasticsearch's search API](http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-request-body.html) actually does it this way. It's been quite annoying not being able to see the generated Elasticsearch query in the logs.

This pull requests enables logging the request body for GET requests.

I also turned `HTTP_METHODS_WITH_BODY` into a `Set`. After benchmarking, it turns out that `Set` is faster than `Array` even for a tiny lookup array such as this.