# Logs history Use the `ably logs history` command to retrieve application log history. ## Synopsis ### Shell ``` ably logs history [options] ``` ## Options ### `--direction` The direction to retrieve logs in. Options are `backwards` or `forwards`. Defaults to `backwards`. ### `--limit` The maximum number of log entries to retrieve. Defaults to `100`. ### `--start` The start of the time range to retrieve logs from. Accepts ISO 8601, Unix milliseconds, or relative time formats. ### `--end` The end of the time range to retrieve logs from. Accepts ISO 8601, Unix milliseconds, or relative time formats. ### `--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 Retrieve recent application logs: ### Shell ``` ably logs history ``` Retrieve logs within a time range: ### Shell ``` ably logs history --start "2025-01-01T00:00:00Z" --end "2025-01-02T00:00:00Z" ``` Retrieve logs in forwards direction: ### Shell ``` ably logs history --direction forwards ``` Retrieve a limited number of application logs: ### Shell ``` ably logs history --limit 20 ``` Retrieve application logs from the last hour: ### Shell ``` ably logs history --start 1h ``` Retrieve application logs in JSON format: ### Shell ``` ably logs history --json ``` Retrieve application logs in formatted JSON: ### Shell ``` ably logs history --pretty-json ``` ## See also * [Logs](https://ably.com/docs/cli/logs.md) — Explore all `ably logs` commands. * [CLI reference](https://ably.com/docs/cli.md) — Full list of available commands. ## Related Topics - [subscribe](https://ably.com/docs/cli/logs/subscribe.md): Subscribe to live app logs using the Ably CLI. ## Documentation Index To discover additional Ably documentation: 1. Fetch [llms.txt](https://ably.com/llms.txt) for the canonical list of available pages. 2. Identify relevant URLs from that index. 3. Fetch target pages as needed. Avoid using assumed or outdated documentation paths.