aspire otel logs command
aspire otel logs - View structured logs from the Dashboard telemetry API.
Synopsis
Section titled “Synopsis”aspire otel logs [resource] [options]Description
Section titled “Description”The aspire otel logs command retrieves and displays structured logs collected by the Aspire Dashboard. You can filter logs by resource name, trace ID, or severity level. Use --follow to stream logs in real-time as they arrive.
Arguments
Section titled “Arguments”-
[resource]Filter by resource name. When specified, only logs from the matching resource are shown. Supports both exact instance names and base resource names (which match all replicas).
Options
Section titled “Options”The following options are available:
-
--apphostThe path to the Aspire AppHost project file.
-
-f, --followStream telemetry in real-time as it arrives.
-
--format <Table|Json>Output format (Table or Json).
-
-n, --limit <limit>Maximum number of items to return.
-
--trace-id <trace-id>Filter by trace ID.
-
--severity <severity>Filter logs by minimum severity (Trace, Debug, Information, Warning, Error, Critical).
-
-?, -h, --helpPrints help and usage documentation for the available commands and options.
-
-d, --debugEnable debug logging to the console, which prints detailed information about what Aspire CLI is doing when a command is run.
-
--wait-for-debuggerWait for a debugger to attach before running a command.
Examples
Section titled “Examples”-
View all structured logs:
Aspire CLI aspire otel logs -
View logs for a specific resource:
Aspire CLI aspire otel logs apiservice -
Stream logs in real-time:
Aspire CLI aspire otel logs --follow -
View only error-level logs in JSON format:
Aspire CLI aspire otel logs --severity Error --format Json -
View the last 50 logs for a resource:
Aspire CLI aspire otel logs apiservice --limit 50