lograge icon indicating copy to clipboard operation
lograge copied to clipboard

How to add extra log payload in action cable?

Open j15e opened this issue 3 years ago • 0 comments

I am looking for a way to do something like this, but in ActionCable context :

# app/controllers/application_controller.rb
class ApplicationController < ActionController::Base
  def append_info_to_payload(payload)
    super
    payload[:host] = request.host
  end
end

I could not find an example; any suggestion? I looked at the lograge code too, but the ActionCable log patching is a bit complex, to say the least. Is it even possible to hook ourselves in the log process in a similar manner with ActionCable?

Thanks!

j15e avatar Apr 21 '22 14:04 j15e