diff --git a/src/frontend/src/content/docs/reference/cli/commands/aspire-logs.mdx b/src/frontend/src/content/docs/reference/cli/commands/aspire-logs.mdx index b52c48714..8340c9dc5 100644 --- a/src/frontend/src/content/docs/reference/cli/commands/aspire-logs.mdx +++ b/src/frontend/src/content/docs/reference/cli/commands/aspire-logs.mdx @@ -18,7 +18,7 @@ aspire logs [] [options] ## Description -The `aspire logs` command displays console logs from resources in a running AppHost. You can view logs for all resources, filter to a specific resource, follow new log entries in real time, and choose table or JSON output for automation. Hidden resources are excluded by default; use the `--include-hidden` option to show their logs. +The `aspire logs` command displays console logs from resources in a running AppHost. You can view logs for all resources, filter to a specific resource, follow new log entries in real time, search log content with full-text filtering, and choose table or JSON output for automation. Hidden resources are excluded by default; use the `--include-hidden` option to show their logs. When executed without the `--apphost` option, the command: @@ -55,6 +55,10 @@ The following options are available: Number of lines to show from the end of the logs. +- **`-s, --search `** + + Full-text search to filter log content. Only log lines whose message or resource name contains the specified text are shown. When connected to an AppHost that supports the v2 or later auxiliary backchannel, filtering is applied server-side before log lines are transferred, which significantly reduces overhead for large log streams. + - **`-t, --timestamps`** Show timestamps for each log line. @@ -111,6 +115,18 @@ The following options are available: aspire logs --include-hidden ``` +- Filter logs by search text: + + ```bash title="Aspire CLI" + aspire logs --search "error" + ``` + +- Search logs for a specific resource and show only the last 75 matching lines: + + ```bash title="Aspire CLI" + aspire logs producer --search needle --tail 75 + ``` + ## See also - [aspire describe](../aspire-describe/)