Skip to content
Docs Try Aspire

aspire otel logs command

aspire otel logs - View structured logs from the Dashboard telemetry API.

Aspire CLI
aspire otel logs [resource] [options]

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.

  • [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).

The following options are available:

  • --apphost

    The path to the Aspire AppHost project file.

  • -f, --follow

    Stream 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, --help

    Prints help and usage documentation for the available commands and options.

  • -d, --debug

    Enable debug logging to the console, which prints detailed information about what Aspire CLI is doing when a command is run.

  • --wait-for-debugger

    Wait for a debugger to attach before running a command.

  • 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