sentry log view
View detailed information about a Sentry log entry by its ID.
Usage
sentry log view [<org>/<project>] <log-id>
Target Specification
sentry log view <log-id> # auto-detect from DSN or config
sentry log view <org>/<proj> <log-id> # explicit org and project
sentry log view <project> <log-id> # find project across all orgs
The log ID is the 32-character hexadecimal identifier shown in log listings.
Arguments
32-character hexadecimal log entry identifierExample:sentry log view a1b2c3d4e5f6a7b8c9d0e1f2a3b4c5d6
Optional target in format <org>/<project> or <project> (searches across orgs)If not provided, auto-detects from DSN in working directory or config defaults.
Flags
Output log data as JSONExample:sentry log view a1b2c3d4e5f6a7b8c9d0e1f2a3b4c5d6 --json
Open the log entry in your default web browser instead of displaying in terminalAlias: -wExample:sentry log view a1b2c3d4e5f6a7b8c9d0e1f2a3b4c5d6 -w
Examples
View a log entry (auto-detect context)
sentry log view a1b2c3d4e5f6a7b8c9d0e1f2a3b4c5d6
View log with explicit org/project
sentry log view my-org/my-project a1b2c3d4e5f6a7b8c9d0e1f2a3b4c5d6
View log with project slug (searches across orgs)
sentry log view my-project a1b2c3d4e5f6a7b8c9d0e1f2a3b4c5d6
Open log in browser
sentry log view a1b2c3d4e5f6a7b8c9d0e1f2a3b4c5d6 --web
sentry log view a1b2c3d4e5f6a7b8c9d0e1f2a3b4c5d6 -w
Output as JSON
sentry log view a1b2c3d4e5f6a7b8c9d0e1f2a3b4c5d6 --json
Sample Output
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Log Entry: a1b2c3d4e5f6a7b8c9d0e1f2a3b4c5d6
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Timestamp: 2024-03-05 14:23:45 UTC
Severity: error
Message: Database connection timeout after 5000ms
Project: my-org/my-project
Trace: abc123def456abc123def456abc123de
Span: def456abc123def456abc123def456ab
Context:
operation: database.query
query: SELECT * FROM users WHERE active = true
duration_ms: 5234
retry_count: 3
Tags:
environment: production
server.name: web-01
region: us-west-2
Link: https://sentry.io/organizations/my-org/logs/a1b2c3d4e5f6a7b8c9d0e1f2a3b4c5d6/
Detected from .env.local
{
"id": "a1b2c3d4e5f6a7b8c9d0e1f2a3b4c5d6",
"timestamp": "2024-03-05T14:23:45Z",
"timestamp_precise": 1709649825000000000,
"severity": "error",
"message": "Database connection timeout after 5000ms",
"trace": "abc123def456abc123def456abc123de",
"span": "def456abc123def456abc123def456ab",
"context": {
"operation": "database.query",
"query": "SELECT * FROM users WHERE active = true",
"duration_ms": 5234,
"retry_count": 3
},
"tags": {
"environment": "production",
"server.name": "web-01",
"region": "us-west-2"
},
"project": {
"slug": "my-project",
"name": "My Project"
}
}
Notes
- Organization and project context is required. If not provided explicitly, it’s resolved from DSN detection or config defaults.
- Log entries are typically retained for 90 days in Sentry.
- The
-w flag is useful for quickly jumping to the Sentry web UI for more context around the log entry.
- Use
sentry trace view <trace-id> to see the full trace and span tree associated with this log entry.
See Also