Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ aspire logs [<resource>] [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:

Expand Down Expand Up @@ -55,6 +55,10 @@ The following options are available:

Number of lines to show from the end of the logs.

- **`-s, --search <search>`**

Full-text search to filter log content. Only log lines whose message or resource name contains the specified text are shown. Multiple words are treated as separate fragments that must all match. Use quoted phrases to match exact multi-word text (for example, `--search '"connection timeout"'`).

- **`-t, --timestamps`**

Show timestamps for each log line.
Expand Down Expand Up @@ -111,6 +115,30 @@ The following options are available:
aspire logs --include-hidden
```

- Filter logs by search text:

```bash title="Aspire CLI"
aspire logs --search "error"
```

- Search with multiple words (all must match):

```bash title="Aspire CLI"
aspire logs --search "connection failed"
```

- Search for an exact phrase using quotes:

```bash title="Aspire CLI"
aspire logs --search '"connection timeout"'
```

- 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/)
Expand Down
Loading