Skip to content
DocsGitHub

log

View Sentry logs

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:

Terminal window
# List the last 100 logs
sentry log list
# Show only error logs
sentry log list -q 'severity:error'
# Filter by message content
sentry log list -q 'database'
# Match a regular expression (key://pattern//)
sentry log list -q 'message://^Timeout after \d+ms//'
# Show the last 50 logs
sentry log list --limit 50
# List logs for a trace
sentry 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 project
sentry log list my-org/backend -f -q 'severity:error'
# Filter JSON output with jq
sentry log list --json | jq '.data[] | select(.severity == "error")'
# Filter by trace in an explicit organization
sentry log list my-org/abc123def456abc123def456abc12345

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:

Terminal window
# View a log entry
sentry log view 968c763c740cfda8b6728f27fb9e9b01
# Specify the project explicitly
sentry log view my-org/backend 968c763c740cfda8b6728f27fb9e9b01
# Open in the browser
sentry log view 968c763c740cfda8b6728f27fb9e9b01 -w
# Find a project across organizations
sentry log view backend 968c763c740cfda8b6728f27fb9e9b01

All commands support --json for machine-readable output and --fields to select specific JSON fields.

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:

  1. In the output of sentry log list (the ID column)
  2. In the Sentry UI when viewing log entries
  3. In the sentry.item_id field 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.

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.