az containerapp logs

Show container app logs.

Commands

Name Description Type Status
az containerapp logs show

Show past logs and/or print logs in real time (with the --follow parameter). Note that the logs are only taken from one revision, replica, and container (for non-system logs).

Core GA

az containerapp logs show

Show past logs and/or print logs in real time (with the --follow parameter). Note that the logs are only taken from one revision, replica, and container (for non-system logs).

az containerapp logs show --name
                          --resource-group
                          [--container]
                          [--follow {false, true}]
                          [--format {json, text}]
                          [--replica]
                          [--revision]
                          [--tail]
                          [--type {console, system}]

Examples

Fetch the past 20 lines of logs from an app and return

az containerapp logs show -n my-containerapp -g MyResourceGroup

Fetch the past 20 lines of system logs from an app and return

az containerapp logs show -n my-containerapp -g MyResourceGroup --type system

Fetch 30 lines of past logs logs from an app and print logs as they come in

az containerapp logs show -n my-containerapp -g MyResourceGroup --follow --tail 30

Fetch logs for a particular revision, replica, and container

az containerapp logs show -n my-containerapp -g MyResourceGroup --replica MyReplica --revision MyRevision --container MyContainer

Required Parameters

--name -n

The name of the Containerapp.

--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=<name>.

Optional Parameters

--container

The name of the container.

--follow

Print logs in real time if present.

Accepted values: false, true
Default value: False
--format

Log output format.

Accepted values: json, text
Default value: json
--replica

The name of the replica. List replicas with 'az containerapp replica list'. A replica may not exist if there is not traffic to your app.

--revision

The name of the container app revision. Defaults to the latest revision.

--tail

The number of past logs to print (0-300).

Default value: 20
--type -t

Type of logs to stream.

Accepted values: console, system
Default value: console
Global Parameters
--debug

Increase logging verbosity to show all debug logs.

--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

--output -o

Output format.

Accepted values: json, jsonc, none, table, tsv, yaml, yamlc
Default value: json
--query

JMESPath query string. See http://jmespath.org/ for more information and examples.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

--verbose

Increase logging verbosity. Use --debug for full debug logs.