log
View Sentry logs
Commands
Section titled “Commands”sentry log list <org/project-or-trace-id...>
Section titled “sentry log list <org/project-or-trace-id...>”List logs from a project
Arguments:
| Argument | Description |
|---|---|
<org/project-or-trace-id...> |
[<org>/[<project>/]]<trace-id>, <org>/<project>, or <project> |
Options:
| Option | Description |
|---|---|
-n, --limit <limit> |
Number of log entries (1-1000) (default: "100") |
-q, --query <query> |
Filter query (e.g., "severity:error", "project:backend", "project:[a,b]") |
-f, --follow <follow> |
Stream logs (optionally specify poll interval in seconds) |
-t, --period <period> |
Time range: "7d", "2024-01-01..2024-02-01", ">=2024-01-01" |
-s, --sort <sort> |
Sort order: "newest" (default) or "oldest" (default: "newest") |
--fresh |
Bypass cache, re-detect projects, and fetch fresh data |
Examples:
# List the last 100 logssentry log list
# Show only error logssentry log list -q 'severity:error'
# Filter by message contentsentry log list -q 'database'
# Match a regular expression (key://pattern//)sentry log list -q 'message://^Timeout after \d+ms//'
# Show the last 50 logssentry log list --limit 50
# List logs for a tracesentry log list abc123def456abc123def456abc12345
# Stream logs (2-second poll interval)sentry log list -f
# Stream logs (5-second poll interval)sentry log list -f 5
# Stream error logs from a specific projectsentry log list my-org/backend -f -q 'severity:error'
# Filter JSON output with jqsentry log list --json | jq '.data[] | select(.severity == "error")'
# Filter by trace in an explicit organizationsentry log list my-org/abc123def456abc123def456abc12345sentry log view <org/project/log-id...>
Section titled “sentry log view <org/project/log-id...>”View details of one or more log entries
Arguments:
| Argument | Description |
|---|---|
<org/project/log-id...> |
[<org>/<project>] <log-id> [<log-id>...] - Target (optional) and one or more log IDs |
Options:
| Option | Description |
|---|---|
-w, --web |
Open in browser |
-f, --fresh |
Bypass cache, re-detect projects, and fetch fresh data |
Examples:
# View a log entrysentry log view 968c763c740cfda8b6728f27fb9e9b01
# Specify the project explicitlysentry log view my-org/backend 968c763c740cfda8b6728f27fb9e9b01
# Open in the browsersentry log view 968c763c740cfda8b6728f27fb9e9b01 -w
# Find a project across organizationssentry log view backend 968c763c740cfda8b6728f27fb9e9b01All commands support --json for machine-readable output and --fields to select specific JSON fields.
Log IDs
Section titled “Log IDs”Copy the full ID from the ID column in sentry log list or sentry trace logs
into sentry log view. An abbreviated prefix can match multiple logs and cannot
be expanded into a unique full ID by itself.
Log IDs can be found:
- In the output of
sentry log list(the ID column) - In the Sentry UI when viewing log entries
- In the
sentry.item_idfield of JSON output
Log ID lookups automatically narrow the search when a usable timestamp can be determined from each ID. Otherwise, they use a 90-day lookup window. If a partial scan leaves IDs missing, the CLI retries those IDs once with the highest available scan accuracy.
JSON Output
Section titled “JSON Output”Use --json for machine-readable output.
In streaming mode with --json, each log entry is output as a separate JSON object (newline-delimited JSON), making it suitable for piping to other tools.