Share via


az cognitiveservices agent logs

Command group 'cognitiveservices agent' is in preview and under development. Reference and support levels: https://aka.ms/CLI_refstatus

Manage hosted agent container logs.

Commands

Name Description Type Status
az cognitiveservices agent logs show

Show logs from a hosted agent container.

Core Preview

az cognitiveservices agent logs show

Preview

Command group 'cognitiveservices agent logs' is in preview and under development. Reference and support levels: https://aka.ms/CLI_refstatus

Show logs from a hosted agent container.

Streams console output (stdout/stderr) or system events from an agent container. Use --follow to stream logs in real-time, or omit it to fetch recent logs and exit. This is useful for troubleshooting agent startup issues or monitoring agent behavior.

az cognitiveservices agent logs show --account-name
                                     --agent-version
                                     --name
                                     --project-name
                                     [--follow]
                                     [--tail]
                                     [--type {console, system}]

Examples

Fetch the last 50 lines of console logs from an agent.

az cognitiveservices agent logs show --account-name myAccount --project-name myProject --name myAgent --agent-version 1

Stream console logs in real-time.

az cognitiveservices agent logs show --account-name myAccount --project-name myProject --name myAgent --agent-version 1 --follow

Fetch the last 100 lines of system event logs.

az cognitiveservices agent logs show --account-name myAccount --project-name myProject --name myAgent --agent-version 1 --type system --tail 100

Stream logs with custom tail size.

az cognitiveservices agent logs show --account-name myAccount --project-name myProject --name myAgent --agent-version 1 --follow --tail 200

Required Parameters

--account-name -a

Cognitive service account name.

--agent-version

Cognitive Services hosted agent version.

--name -n

Cognitive Services hosted agent name.

--project-name -p

AI project name.

Optional Parameters

The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.

--follow -f

Stream logs in real-time. Without this flag, fetches recent logs and exits.

Property Value
Default value: False
--tail

Number of trailing log lines to fetch (1-300). Default: 50.

Property Value
Default value: 50
--type -t

Type of logs to stream. 'console' for stdout/stderr, 'system' for container events.

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

Increase logging verbosity to show all debug logs.

Property Value
Default value: False
--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

Property Value
Default value: False
--output -o

Output format.

Property Value
Default value: json
Accepted values: json, jsonc, none, table, tsv, yaml, yamlc
--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.

Property Value
Default value: False