diff --git a/actioncable/app/javascript/action_cable/logger.js b/actioncable/app/javascript/action_cable/logger.js index ef4661ead1c..f4b99390c19 100644 --- a/actioncable/app/javascript/action_cable/logger.js +++ b/actioncable/app/javascript/action_cable/logger.js @@ -1,5 +1,10 @@ import adapters from "./adapters" +// The logger can be enabled with: +// +// ActionCable.logger.enabled = true +// + export default { log(...messages) { if (this.enabled) { diff --git a/guides/source/action_cable_overview.md b/guides/source/action_cable_overview.md index 3dc75bcfa60..f456948c75b 100644 --- a/guides/source/action_cable_overview.md +++ b/guides/source/action_cable_overview.md @@ -771,6 +771,14 @@ config.action_cable.log_tags = [ For a full list of all configuration options, see the `ActionCable::Server::Configuration` class. +Client-side logs can be enabled with the following: + +```ruby +import * as ActionCable from '@rails/actioncable' + +ActionCable.logger.enabled = true +``` + ## Running Standalone Cable Servers ### In App