[ aws . amplifygen3 . logs ]

get

Description

Print the logs of an environment, or the deployment log of one deployment. Choose which logs with –log-type; runtime logs are the default.

Runtime, access, firewall and database logs cover the whole environment, from the last hour by default. The deployment log covers one deployment, the newest by default, even if its build failed; pick another with –active or –deployment-id. It holds the deployment’s build output and, for an app with a backend, its migration lines, prefixed [migrate]. The whole log is shown by default. With –deployment-id, database logs show only that deployment’s migration lines, from when it started until 2 minutes after it ended. Database logs can be narrowed to one branch with –branch-arn. Pass –follow to keep printing new lines as they arrive; for the deployment log, it stops when the deployment ends, and for database logs with –deployment-id, 2 minutes after it ends. In CI or when run by an agent, –follow stops after 1 minute (2 minutes for database logs) unless you pass –timeout.

A new environment has no runtime, access, or firewall logs until it serves its first request; the command says so and exits successfully. A static site never has runtime logs, since only server code writes them, and an app with no backend has no database logs. Access logs include the backend’s requests. Access and firewall logs can be sampled, so they may not include every request; check the rates with aws amplifygen3 logs-config get.

Synopsis

  get
[--env <value>]
[--app <value>]
[--log-type <value>]
[--start-time <value>]
[--since <value>]
[--end-time <value>]
[--filter <value>]
[--branch-arn <value>]
[--follow]
[--timeout <value>]
[--latest]
[--active]
[--deployment-id <value>]
[--debug]
[--endpoint-url <value>]
[--no-verify-ssl]
[--no-paginate]
[--output <value>]
[--query <value>]
[--profile <value>]
[--region <value>]
[--version <value>]
[--color <value>]
[--no-sign-request]
[--ca-bundle <value>]
[--cli-read-timeout <value>]
[--cli-connect-timeout <value>]
[--cli-binary-format <value>]
[--no-cli-pager]
[--cli-auto-prompt]
[--no-cli-auto-prompt]
[--cli-error-format <value>]
[--help]

Options

--env (string) Environment to read logs from. Defaults to preview. Shorthand: -e.

--app (string) App name. If omitted, the name is read from amplify.jsonc in the current directory, then package.json, then the current directory name. Shorthand: -a.

--log-type (string) Which logs to show: ‘runtime’ (the default) for what your app writes while it runs, ‘access’ for the requests the environment served, the backend’s included (sampled), ‘firewall’ for the requests checked by the firewall (AWS WAF), ‘deployment’ (alias ‘build’) for one deployment’s migration lines and build output, or database for the backend database’s Postgres logs.

  • runtime
  • access
  • deployment
  • build
  • firewall
  • database

--start-time (string) Start of the time range, for example “3 hours ago”, “yesterday” (midnight UTC), or 2026-04-30T12:00:00Z. Defaults to 1 hour ago, or to the start of the build with –log-type deployment. Cannot be used with –since.

--since (string) Start the time range this long ago, for example 30m, 3h, or 7d. Units are s, m, h, d, and w. Cannot be used with –start-time.

--end-time (string) End of the time range, in the same formats as –start-time. Defaults to now.

--filter (string) Only show lines that match this CloudWatch Logs filter pattern, for example ERROR.

--branch-arn (string) Show only the lines of this branch (arn:aws:amplifygen3:<region>:<account>:app/<app>/environment/<env>/branch/<name>). Requires --log-type database. The app and environment are read from the ARN, and –env is ignored. aws amplifygen3 branch get --name <branch> --env <env> shows a branch’s ARN, and aws amplifygen3 branch list --env <env> --output json lists them.

--follow (boolean) Keep running and print new lines as they arrive, until you press Ctrl+C. With –log-type deployment, it stops when the deployment ends; with –deployment-id and –log-type database, 2 minutes after the deployment ends. In CI or when run by an agent, it stops after 60 seconds (2 minutes with –log-type database) unless you pass –timeout. Shorthand: -f.

--timeout (string) How long –follow runs before it stops, for example 30s, 5m, or 1h. Defaults to no limit in a terminal (30m with –log-type deployment, and with –log-type database and –deployment-id) and, in CI or when run by an agent, 60s (2m with –log-type database). Has no effect without –follow.

--latest (boolean) Use the newest deployment, even if it is still building or failed. This is the default. Use only one of –latest, –active, and –deployment-id.

--active (boolean) Use the environment’s active deployment. This picks which deployment log –log-type deployment shows. Runtime, access, firewall, and database logs cover the whole environment, so –active does not narrow them, and each line is shown once even when traffic is split between deployments.

--deployment-id (string) Use this deployment. If it belongs to a different environment than –env, the command warns and uses that environment. With –log-type database, shows only this deployment’s migration lines. Shorthand: -d.

Global Options

--debug (boolean)

Turn on debug logging.

--endpoint-url (string)

Override command’s default URL with the given URL.

--no-verify-ssl (boolean)

By default, the AWS CLI uses SSL when communicating with AWS services. For each SSL connection, the AWS CLI will verify SSL certificates. This option overrides the default behavior of verifying SSL certificates.

--no-paginate (boolean)

Disable automatic pagination. If automatic pagination is disabled, the AWS CLI will only make one call, for the first page of results.

--output (string)

The formatting style for command output.

  • json
  • text
  • table
  • yaml
  • yaml-stream
  • off

--query (string)

A JMESPath query to use in filtering the response data.

--profile (string)

Use a specific profile from your credential file.

--region (string)

The region to use. Overrides config/env settings.

--version (string)

Display the version of this tool.

--color (string)

Turn on/off color output.

  • on
  • off
  • auto

--no-sign-request (boolean)

Do not sign requests. Credentials will not be loaded if this argument is provided.

--ca-bundle (string)

The CA certificate bundle to use when verifying SSL certificates. Overrides config/env settings.

--cli-read-timeout (int)

The maximum socket read time in seconds. If the value is set to 0, the socket read will be blocking and not timeout. The default value is 60 seconds.

--cli-connect-timeout (int)

The maximum socket connect time in seconds. If the value is set to 0, the socket connect will be blocking and not timeout. The default value is 60 seconds.

--cli-binary-format (string)

The formatting style to be used for binary blobs. The default format is base64. The base64 format expects binary blobs to be provided as a base64 encoded string. The raw-in-base64-out format preserves compatibility with AWS CLI V1 behavior and binary values must be passed literally. When providing contents from a file that map to a binary blob fileb:// will always be treated as binary and use the file contents directly regardless of the cli-binary-format setting. When using file:// the file contents will need to properly formatted for the configured cli-binary-format.

  • base64
  • raw-in-base64-out

--no-cli-pager (boolean)

Disable cli pager for output.

--cli-auto-prompt (boolean)

Automatically prompt for CLI input parameters.

--no-cli-auto-prompt (boolean)

Disable automatically prompt for CLI input parameters.

--cli-error-format (string)

The formatting style for error output. By default, errors are displayed in enhanced format.

  • legacy
  • json
  • yaml
  • text
  • table
  • enhanced

--help (boolean)

Display help for the command/subcommand.

Examples

Note

To use the following examples, you must have the AWS CLI installed and configured. See the Getting started guide in the AWS CLI User Guide for more information.

Unless otherwise stated, all examples have unix-like quotation rules. These examples will need to be adapted to your terminal’s quoting rules. See Using quotation marks with strings in the AWS CLI User Guide .

Example 1: To read an environment’s runtime logs

The following logs get example prints the runtime logs of an environment from the last hour, which is the default window. Output is your application’s own log lines, so it is not reproduced here.

aws amplifygen3 logs get \
    --app my-app \
    --env production

Example 2: To follow logs as they arrive

The following logs get example streams new log lines until you stop it. --timeout bounds the wait, and in CI (CI=true) a cap applies so the command cannot hang a pipeline.

aws amplifygen3 logs get \
    --app my-app \
    --env production \
    --follow

Example 3: To read the deployment log of the newest deployment

The following logs get example prints the deployment log instead of runtime logs. The deployment log covers one deployment, the newest by default, even if its build failed – which is what makes this the command to reach for when a deploy fails in Amplify but succeeds locally.

aws amplifygen3 logs get \
    --app my-app \
    --env preview \
    --log-type deployment

Example 4: To read the deployment log of a specific deployment

The following logs get example picks a deployment by ID rather than taking the newest. --active selects the deployment the environment is serving instead.

aws amplifygen3 logs get \
    --app my-app \
    --env preview \
    --log-type deployment \
    --deployment-id d-ghi789rst

Example 5: To search a wider time range

The following logs get example reads the last 24 hours of access logs and keeps only the lines matching a pattern. --since takes a duration; --start-time and --end-time take absolute times.

aws amplifygen3 logs get \
    --app my-app \
    --env production \
    --log-type access \
    --since 24h \
    --filter "/checkout"

Access and firewall logs are only recorded if sampling is configured for the environment. Check it with aws amplifygen3 logs-config get.