Skip to content

Logging issues #73

Description

@jwoertink

Today I learned that when you have a connection in a channel, and you broadcast a message to that channel, Cable will log once for each connection on that channel...

So this means, if you have a chat channel with 100 users, and you send "hi", your server will log out the "hi" broadcast 100 times:

▸ ChatChannel transmitting {"event" => "ChatMessage", "id" => "10170723-83be-4918-b00a-e9bcc95a6227", "type" => "ChatMessageReceived", "text" => "hi", "createdAt" => "2023-06-27T16:41:18Z"} (via streamed from chatroom:1)
▸ ChatChannel transmitting {"event" => "ChatMessage", "id" => "10170723-83be-4918-b00a-e9bcc95a6227", "type" => "ChatMessageReceived", "text" => "hi", "createdAt" => "2023-06-27T16:41:18Z"} (via streamed from chatroom:1)
▸ ChatChannel transmitting {"event" => "ChatMessage", "id" => "10170723-83be-4918-b00a-e9bcc95a6227", "type" => "ChatMessageReceived", "text" => "hi", "createdAt" => "2023-06-27T16:41:18Z"} (via streamed from chatroom:1)
▸ ChatChannel transmitting {"event" => "ChatMessage", "id" => "10170723-83be-4918-b00a-e9bcc95a6227", "type" => "ChatMessageReceived", "text" => "hi", "createdAt" => "2023-06-27T16:41:18Z"} (via streamed from chatroom:1)
▸ ChatChannel transmitting {"event" => "ChatMessage", "id" => "10170723-83be-4918-b00a-e9bcc95a6227", "type" => "ChatMessageReceived", "text" => "hi", "createdAt" => "2023-06-27T16:41:18Z"} (via streamed from chatroom:1)
....

For now, you can disable logs with Cable::Logger.level = :none

Metadata

Metadata

Assignees

No one assigned

    Labels

    hacktoberfestValid Issue for Hacktoberfest

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions