lograge icon indicating copy to clipboard operation
lograge copied to clipboard

Ability to disable ActionCable MonkeyPatch

Open jwhitcraft opened this issue 6 years ago • 6 comments

We are using this gem currently, but we want to migrate away from ActionCable in-favor of AnyCable, but when this gem it doesn't allow us to since AnyCable uses a custom ActionCable::Connection::Base class found here which has a custom handle_open and handle_close. Would it be possible to provide a way to disable ActionCable Logging?

Thanks.

jwhitcraft avatar Jun 21 '19 17:06 jwhitcraft

As another use case for the ability to disable action cable integration we run a separate cable server and the default Rails logs are much more verbose. For example we get "unauthorized connection attempt" events which don't seem to come through with this. I know this isn't your fault and the logging in ActionCable is a mess, but it'd be great if we could use lograge on our main app and keep the Rails default on the ActionCable server.

Additionally IP address isn't available in the ActionCable logs which is a critical one for us as we want to know IPs when there are bad actors

georgepalmer avatar Nov 07 '19 13:11 georgepalmer

FYI - this is still an issue today. https://github.com/roidrage/lograge/issues/304 appears to address this fully (not splitting up log handlers but allowing lograge to work with both main app and action cable/anycable)

uhrohraggy avatar Jun 17 '21 12:06 uhrohraggy

@georgepalmer have you successfully monkey patched the monkey patch out of your system? I need to isolate and reduce complexity because i'm spending too much time on this.

After updating to latest anycable, sentry, lograge, rails 7 i'm now imploding here

wrong number of arguments (given 1, expected 0)
lograge (bf6954566607) lib/lograge/rails_ext/action_cable/channel/base.rb in subscribe_to_channel at line 6

rromanchuk avatar Feb 28 '22 00:02 rromanchuk

@rromanchuk have you tried the master version? This should be fixed on master.

iloveitaly avatar Mar 01 '22 00:03 iloveitaly

@iloveitaly reverting back to palkan/lograge fixed it, I probably only had roidrage/lograge thinking it was already tagged. I'll try again later

rromanchuk avatar Mar 01 '22 01:03 rromanchuk

@rromanchuk roidrage/lograge should contain the fix for this (https://github.com/roidrage/lograge/commit/2fd03f78a78bc0d964fd48d281126a4cd58c7d79). Is roidrage/lograge master not working for you? What error are you running into?

iloveitaly avatar Mar 01 '22 11:03 iloveitaly