Skip to content

Commit 460735e

Browse files
committed
Truncate more ActionCable broadcast messages to 300 chars
Truncation to ActionCable logging was added way back in 2016, but here's another location where the logging messages can get out of hand.
1 parent e9559f4 commit 460735e

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

actioncable/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
* Truncate broadcast logging messages.
2+
3+
*J Smith*
4+
15
* OpenSSL constants are now used for Digest computations.
26

37
*Dirkjan Bussink*

actioncable/lib/action_cable/server/broadcasting.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ def initialize(server, broadcasting, coder:)
4040
end
4141

4242
def broadcast(message)
43-
server.logger.debug { "[ActionCable] Broadcasting to #{broadcasting}: #{message.inspect}" }
43+
server.logger.debug { "[ActionCable] Broadcasting to #{broadcasting}: #{message.inspect.truncate(300)}" }
4444

4545
payload = { broadcasting: broadcasting, message: message, coder: coder }
4646
ActiveSupport::Notifications.instrument("broadcast.action_cable", payload) do

0 commit comments

Comments
 (0)