Skip to content

How to add extra log payload in action cable? #349

@j15e

Description

@j15e

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!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions