Forum: Ruby on Rails Logger in ActionWebService::Base?

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
A7baaf7d9b663bfbdf1902e5eac3d084?d=identicon&s=25 Ray Black (Guest)
on 2006-06-08 00:48
(Received via mailing list)
I'd like to split up my directly dispatched controller into a layered
dispatch setup with one controller and two services derived from
ActionWebService::Base. However, in doing this I found that logger is
not a class_variable of AWS::Base. This kind of scares me away from
using the layered dispatch mode, as I'd like to have logging in the
method implementations. Is there a clean way of accessing the
Rails::Configuration logger from ActionWebService::Base, or should I
stick with web_service_dispatch_mode :direct for now?

class FooController < ApplicationController
  web_service_dispatching_mode :layered
  web_service(:bar)  { BarService.new }
end

class BarApi < ActionWebService::API::Base
  api_method :qux
end

class BarService < ActionWebService::Base
  def qux
    p logger
  end
end

gives:

NameError (undefined local variable or method `logger' for
#<BarService:0xb76a5c2c>):
...
This topic is locked and can not be replied to.