az containerapp logs

Note

This reference is part of the containerapp extension for the Azure CLI (version 2.37.0 or higher). The extension will automatically install the first time you run an az containerapp logs command. Learn more about extensions.

Show container app logs.

Commands

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.

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.

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

Examples

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

az containerapp logs show -n MyContainerapp -g MyResourceGroup

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

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

Fetch logs for a particular revision, replica, and container

az containerapp logs show -n MyContainerapp -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
--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