aspire otel logs command
Dette indhold er ikke tilgængeligt i dit sprog endnu.
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:
-
--apphost <apphost>The path to the Aspire AppHost project file. Mutually exclusive with
--dashboard-url. -
--dashboard-url <url>The URL of a standalone Aspire Dashboard to query instead of discovering one from an AppHost. Accepts a base URL (for example,
http://localhost:18888) or a full login URL including a browser token (for example,http://localhost:18888/login?t=<token>). When a login URL is provided, the token is automatically exchanged for an API key. Mutually exclusive with--apphost. -
--api-key <key>The API key used to authenticate with the dashboard’s Telemetry API. Only required when
--dashboard-urlis specified and the dashboard is configured withApiKeyauthentication and no login URL is provided. -
-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.
-
-l, --log-level <Critical|Debug|Error|Information|None|Trace|Warning>Set the minimum log level for console output. Use this option to increase diagnostics while troubleshooting or reduce output in scripted runs.
-
--non-interactiveRun the command in non-interactive mode, disabling all interactive prompts and spinners.
-
--nologoSuppress the startup banner and telemetry notice.
-
--bannerDisplay the animated Aspire CLI welcome banner.
-
--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 -
View logs from a standalone dashboard using the login URL (token is automatically exchanged for an API key):
Aspire CLI aspire otel logs --dashboard-url "http://localhost:18888/login?t=<token>" -
View logs from a secured standalone Aspire Dashboard:
Aspire CLI aspire otel logs --dashboard-url "http://localhost:18888" --api-key "<your-api-key>"