Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SemanticLogger is incompatible with ActionCable::Connection because of ActionCable::Connection::TaggedLoggerProxy #220

Open
kristoph opened this issue Jun 25, 2024 · 2 comments

Comments

@kristoph
Copy link

Attempting to include SemanticLogger::Loggable in a class derived from ActionCable::Connection::Base will mean connect on the base class will never be called.

Because ActionCable::Connection implements its own logger, the TaggedLoggerProxy, any attempt to call a logger method with more than the message parameter will fail with "ArgumentError(wrong number of arguments (given 2, expected 0..1))" because such methods do not exist on TaggedLoggerProxy.

This is even true when you manually construct a logger because ActionCable::Connection::Base wraps the logger.

I am using Ruby 3.2 with actioncable-7.1.3.4,

@reidmorrison
Copy link
Owner

It is unlikely just adding "SemanticLogger::Loggable in a class derived from ActionCable::Connection::Base" would work for Rails. It usually requires far more extensive patching.

Start here to see the patches for the other Rails frameworks and the community contributed fix that may help, to see what changes would be required to support Rails 7.1 Action Cable:

%i[active_record action_controller action_mailer action_view].each do |name|

A Tagged proxy patch:

At some point it will also need its own log subscriber to break down the text messages into log events. Below is an example of how this is being done for Action Controller:

class LogSubscriber < ActiveSupport::LogSubscriber

@tcannonfodder
Copy link

Is there any way to work around this for ActionCable? Currently this is breaking ActionCable from being able to establish connections in my app

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants