Logs and debugging
Read and search logs, check resource use, diagnose problems, and open a shell in your app.
stackblaze logs
Prints the linked app's logs, oldest first. By default it shows recent lines from the running app, falling back to the log store for the last --minutes when there are none.
stackblaze logs [options]-f streams new lines until you press Ctrl+C and reconnects after network drops. --search queries the durable log store with --query, --level and --minutes. --follow and --search cannot be combined. Build logs are separate: see stackblaze builds logs.
JSON: the default mode prints one document with a logs array; --search prints hits and num_hits; --follow prints one JSON object per line as it arrives.
| Flag | Description |
|---|---|
-n, --limit <n> | Show the newest n lines (with -f, print the last n first; with --search, default 100) |
-f, --follow | Stream live logs |
--search | Search the log store instead of the live buffer |
-q, --query <text> | Full-text query (--search) |
--level <level> | Log level filter (--search) |
--minutes <n> | Look-back window in minutes (default 60) |
--container <name> | Container to read (default: the app's web container) |
Also accepts the scope flags (-p, --pipeline, --phase, -a, --app) and the output flags (-o, --output, --json), plus --token and --api-url. Common flags
Examples
stackblaze logs -n 200
stackblaze logs -f
stackblaze logs -f -n 50 -a worker
stackblaze logs --search -q "timeout" --level error --minutes 180stackblaze metrics
Prints current CPU (millicores) and memory (MiB) for each running instance of the linked app. For history, use stackblaze diagnose or the dashboard.
stackblaze metricsAlso accepts the scope flags (-p, --pipeline, --phase, -a, --app) and the output flags (-o, --output, --json), plus --token and --api-url. Common flags
Examples
stackblaze metrics -a apistackblaze events
Prints the linked app's recent platform events (reason and message). Useful when an app does not start.
stackblaze eventsAlso accepts the scope flags (-p, --pipeline, --phase, -a, --app) and the output flags (-o, --output, --json), plus --token and --api-url. Common flags
Examples
stackblaze events -a apistackblaze diagnose
Collects the app's configuration, metrics, recent logs and add-on state, and reports findings and hints.
stackblaze diagnose [--scale <window>] [--log-minutes <n>]| Flag | Description |
|---|---|
--scale <window> | Metrics window: 2h (default), 24h or 7d |
--log-minutes <n> | Log search window in minutes |
Also accepts the scope flags (-p, --pipeline, --phase, -a, --app) and the output flags (-o, --output, --json), plus --token and --api-url. Common flags
Examples
stackblaze diagnose --scale 24hstackblaze ssh
Opens an interactive terminal inside a running instance of the linked app, over the API: no SSH keys and no open ports. Remote console access must be enabled on the platform; if it is not, the command reports a console error. Exits with the remote session's exit code.
stackblaze ssh [--pod <name>] [--container <name>] [--command <shell>]| Flag | Description |
|---|---|
--pod <name> | Instance to connect to (default: the app's first instance) |
--container <name> | Container (default: the web container, else the first) |
--command <shell> | Command to start (default sh) |
Also accepts the scope flags (-p, --pipeline, --phase, -a, --app), plus --token and --api-url. Common flags
Examples
stackblaze ssh
stackblaze ssh --command bash -a worker