Use the ably logs subscribe command to subscribe to live app logs.
Synopsis
ably logs subscribe [options]Options
--type
Filter logs by type. Options are channel.lifecycle, channel.occupancy, channel.presence, connection.lifecycle, and push.publish.
--duration | -D
The duration in seconds to subscribe for before automatically unsubscribing.
--rewind
The number of messages to rewind when subscribing. Defaults to 0.
--client-id
A client ID to use when subscribing.
--json
Output results as compact JSON. Mutually exclusive with --pretty-json.
--pretty-json
Output results in formatted JSON. Mutually exclusive with --json.
--verbose | -v
Enable verbose logging. Can be combined with --json or --pretty-json.
Examples
Subscribe to all app logs:
ably logs subscribeFilter by log type:
ably logs subscribe --type channel.lifecycleSubscribe with rewind to receive recent logs:
ably logs subscribe --rewind 10Subscribe to application logs for a specific duration:
ably logs subscribe --duration 30Subscribe to application logs in JSON format:
ably logs subscribe --jsonSubscribe to application logs in formatted JSON:
ably logs subscribe --pretty-jsonSee also
- Logs — Explore all
ably logscommands. - CLI reference — Full list of available commands.