Skip to content

Read logs

Read the log tail of a build or deploy operation, and the recent Cloud Run logs of a deployed service, without leaving the terminal.

Prerequisites

  • For build and deploy logs, the operation name, printed by alis build, alis deploy and alis define (with --async or in the final result) and listed by alis operations list.
  • For runtime logs, the deployment environment id from alis context view --json.

Build logs

alis logs build operations/<id>

The output groups lines by build target, one group per image (BUILD ., BUILD worker). --limit caps the lines per group (default 200, also capped at 128 KiB); a group that was cut is marked truncated. When the operation was started on another machine, add --package <pkg> so the CLI can resolve it.

Deploy logs

alis logs deploy operations/<id>

The Terraform plan or apply output of the deploy, grouped per deployment, with the same --limit and --package flags. The operation result's logsUri opens the full execution log in the browser.

Runtime logs

alis logs runtime acme.sh.orders.v1 -e <env-id> --since 1h --limit 200

Recent Cloud Run log entries of the service in the deployment environment's configured region, newest first. --since looks back at most 168h (default 30m); --limit accepts 1 to 1000 (default 100). -e takes the deployment environment id or its display name. Inside the service folder the package id can be omitted. With --json the result carries projectId, the services matched and the entries.

A service that is not deployed in that deployment environment returns NOT_FOUND.

Follow a failure from the operation result

When an operation fails, read the final JSON first: error, logsUri, images[].progress.failure for builds and deployments[].progress.failure for deploys carry the last error lines. Then open the logs above for context.

Monitoring emails

Each deployment environment's Monitoring page in the console takes email addresses that receive alerts for that deployment environment.