Disable rails log for ActionCable events

人盡茶涼 提交于 2019-12-05 00:06:59

To completely disable logging from ActionCable you should configure ActionCable to use logger that do nothing

ActionCable.server.config.logger = Logger.new(nil)

Same here, finally I found a solution. You should override a code in /app/channels/application_cable/channel.rb as follows

module ApplicationCable

  class Channel < ActionCable::Channel::Base

    def dispatch_action(action, data)

      #logger.info action_signature(action, data)

      if method(action).arity == 1
        public_send action, data
      else
        public_send action
      end
    end
  end
end

You can simulate the original behavior by uncommenting out #logger.info action_signature(action, data) line.

Thanks.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!