httparty: how to log request?

Use debug_output at the class level:

class Foo
  include HTTParty
  debug_output $stdout
end

or per request

response = HTTParty.post(url, :body => body, :debug_output => $stdout)

You ca use a built-in logger:

my_logger = Rails.logger || Logger.new # use what you like
my_logger.info "The default formatter is :apache. The :curl formatter can also be used."
my_logger.info "You can tell which method to call on the logger too. It is info by default."

HTTParty.get "http://google.com", logger: my_logger, log_level: :debug, log_format: :curl