Logger in ActionWebService::Base?


#1

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):