Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

An instance-level logger would be nice #84

Closed
trptcolin opened this issue Sep 15, 2010 · 4 comments
Closed

An instance-level logger would be nice #84

trptcolin opened this issue Sep 15, 2010 · 4 comments
Milestone

Comments

@trptcolin
Copy link

It would be great if you could set the Savon logger at the Savon::Client level. This way, one client in a VM could set a different logger than another.

Is there another way to do this that I'm not seeing, or would a patch be welcome for this?

Thanks!

-Colin

@rubiii
Copy link
Contributor

rubiii commented Oct 19, 2010

definitely. i would love to have the same set of global options available per client as well. still struggling with the perfect implementation though.

@walle
Copy link
Contributor

walle commented Apr 5, 2011

I have started a little naive implementation of this in:
https://github.com/walle/savon/tree/enable_per_client_config

The thing that is left is to make these classes aware of which client is using them

  • lib/savon/core_ext/hash.rb
  • lib/savon/soap/request.rb
  • lib/savon/soap/response.rb
  • lib/savon/soap/xml.rb
  • lib/savon/wsdl/request.rb

And probably a 100 things I haven't thought about :)

The branch is not production ready yet for a while. Eg. the Savon module is not DRY what so ever now. It should act as a proxy for its @config object but since I'm kind of new to ruby I couldn't figure out a nice way to do this tonight.

@rubiii rubiii closed this as completed in ed0260f Jun 6, 2012
@rubiii
Copy link
Contributor

rubiii commented Jun 6, 2012

released with v0.9.10. here's how to set a custom log subject:

client = Savon.client("http://example.com")
client.config.logger.subject = Logger.new("./log/savon.log")

please notice that client.config.logger by default returns a Savon::Logger that wraps a log subject
to allow logged xml requests and responses to be filtered and pretty printed.

@trptcolin
Copy link
Author

Nice, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

3 participants