Add log_rpc option to suppress noisy per-request RPC trace logs#5
Open
noah44846 wants to merge 1 commit intoanycable:mainfrom
Open
Add log_rpc option to suppress noisy per-request RPC trace logs#5noah44846 wants to merge 1 commit intoanycable:mainfrom
log_rpc option to suppress noisy per-request RPC trace logs#5noah44846 wants to merge 1 commit intoanycable:mainfrom
Conversation
When used with anycable-rails, AnyCable's logger gets replaced by the Rails logger, making log_level/log_file config ineffective for filtering RPC-specific noise. Add log_rpc (default: true) to suppress the per-request trace logs (connect/command/disconnect and broadcast enqueue/perform) while still surfacing errors. Follows the same pattern as log_grpc.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Hey!
When debugging a Rails app with AnyCable, I noticed that every incoming HTTP RPC call (connect/command/disconnect) gets logged with the full request payload — including long session tokens, cookies, and serialized connection data. This makes the Rails log very hard to read when you're trying to follow your application logic, since the RPC trace lines are verbose and repeat information ActionCable already logs in a more readable form.
The root cause is that
anycable-railsreplacesAnyCable.loggerwithRails.logger, so the existinglog_levelandlog_fileconfig options have no effect — you'd have to lower the log level for your entire Rails app to get rid of the noise, which is not acceptable in my case.This adds a
log_rpcconfig option (default:true) to opt out of per-request RPC trace logs while keeping everything else — including errors — untouched. Follows the same pattern as the existinglog_grpcoption.Changes
log_rpcconfig option (default:true) — set tofalseto suppress per-requestinfo/debugtrace logs in RPC handlers (connect/command/disconnect) and the HTTP broadcast adapter (enqueue/perform). Errors are unaffected.Checklist
Usage: