Search code examples
ruby-on-railsrubyxmlsavon

Get the XML request sent by Savon gem rails


I want to get the XML request sent by Savon 2 gem in rails.

I tried setting log: true while initializing the Savon but it doesn't seem to be working as I'm not getting the request that is sent by the Savon in the log file.

I also tried Savon.client: :pretty_print_xml => true and client.config.pretty_print_xml = true , but they are also not working.


Solution

  • Try using Rails logger and debug log level by passing appropriate arguments:

    Savon.client(log: true, logger: Rails.logger, log_level: :debug)