2

How to enable the logging of the request body by Faraday? Especially, I want to know the quick way to dump the body, header to stdout.

Kai Sasaki
  • 667
  • 4
  • 13

1 Answers1

2

I found a good resource to show how to log the body in Faraday.

https://github.com/lostisland/faraday/issues/254

require "logger"

Faraday.new do |faraday|
  faraday.response :logger, ::Logger.new(STDOUT), bodies: true
end
Kai Sasaki
  • 667
  • 4
  • 13