aspire otel logs command

Name

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

Synopsis

aspire otel logs [resource] [options]

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

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

The following options are available:

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

            • Examples

  • View all structured logs:

    aspire otel logs
    
  • View logs for a specific resource:

    aspire otel logs apiservice
    
  • Stream logs in real-time:

    aspire otel logs --follow
    
  • View only error-level logs in JSON format:

    aspire otel logs --severity Error --format Json
    
  • View the last 50 logs for a resource:

    aspire otel logs apiservice --limit 50
    

See also