Search code examples
rubywsdlsavon

Ruby Savon Gem change logging configuration


I've tried changing the logging on Savon when running it against a WSDL, but have been unsuccessful in changing the logging level.

I read the docs: http://rubiii.github.com/savon/#global_configuration

I did this:

Savon.configure do |config|
  config.log = false            # disable logging
  config.log_level = :info      # changing the log level
  config.logger = Rails.logger  # using the Rails logger
end

And it complains about not knowing what configure means.. any ideas?


Solution

  • This documentation you linked is for savon 0.8, you may be using an older version. When in doubt, go to the source code (path is platform-dependent) and check how the code/test do it:

    $ cd /usr/lib/ruby/gems/1.8/gems/savon-0.7.8
    $ grep -lr log_level * 
    lib/savon/logger.rb
    spec/savon/request_spec.rb
    $ cat spec/savon/request_spec.rb
    ...
    Savon::Request.log_level = :info
    ...