Read Sentry Logs from PHP on your own machine
Point your Sentry PHP SDK at Buggregator with a numeric DSN and write lines with \Sentry\logger(). The Sentry logs show up in the Logs tab on your machine, filtered by level, with no Sentry account and nothing sent to the cloud. When tracing is on, each line also links to its trace.
Steps
1. Point the SDK at Buggregator
Keep the number in the DSN path. Events with a number go to the default project, which the UI shows from the start. In Laravel, set SENTRY_LARAVEL_DSN to the same value instead.
SENTRY_DSN=http://sentry@127.0.0.1:8000/1The PHP SDK reads SENTRY_DSN from the environment when \Sentry\init() gets no dsn (https://docs.sentry.io/platforms/php/configuration/options/). In Docker Compose, replace 127.0.0.1 with the Buggregator service name, for example buggregator.
2. Write a log line
Logs need sentry/sentry 4.12 or newer. Before 4.31, also set 'enable_logs' => true in init. Call the logger where something happens, and flush at the end.
\Sentry\logger()->info('Order %s paid', [42]);
\Sentry\logger()->flush(); // at the end of the request or jobIn Laravel (sentry-laravel 4.15 or newer), set SENTRY_ENABLE_LOGS=true in .env, add sentry_logs to LOG_STACK as Sentry's Laravel logs guide shows, and write with Log::info().
3. Open the Logs tab
Open the Sentry page and pick Logs. The tab appears once the current project has log lines. The open tab shows new lines without a reload. Open a line to see its attributes. Scripts can read the same data:
GET /api/sentry/logsIt filters by project, level, trace_id and time.
4. Use your own project name, if you want one
A key in the DSN path, such as /my-app, sends the data to that project. A project that receives only logs is not added to the project list, so declare it under projects: in buggregator.yaml and pick it in the sidebar.
Why it works
Buggregator accepts the same protocol the Sentry SDK uses, so it stores the logs the SDK sends, next to errors, traces and metrics. With tracing on (traces_sample_rate), a log line carries the ID of the trace it was written in, and links to that trace once Buggregator has stored it.
Docs: docs.buggregator.dev/config/sentry.html#traces-logs-and-metrics
Requires Buggregator v2.6.0+
Related tips
- Sentry
See a Laravel request's Sentry trace as a waterfall
Turn on Sentry tracing in Laravel and send it to Buggregator. Every span of a request shows on a timeline, and errors link to their trace.
- Sentry
See what happened right before the exception
Point your Laravel Sentry DSN at Buggregator. Each error shows its breadcrumbs, request, tags and stack trace on your laptop.
- MCP
Claude Code reads your app's errors over MCP
Add Buggregator as an MCP server in Claude Code. It lists your Sentry errors, opens stack traces and reads dumps and profiles. No copy-paste.
Checked on with Buggregator v2.8.0