Skip to main content

Laravel errors in Sentry's UI style, no Sentry account

Install sentry/sentry-laravel and set one line in .env: SENTRY_LARAVEL_DSN=http://sentry@127.0.0.1:8000/1. Every exception your Laravel app reports then shows up in Buggregator on your machine, with the stack trace, the request and the breadcrumbs that led to it. No Sentry account is needed.

Steps

1. Start Buggregator

bash
docker run --pull always \
  -p 127.0.0.1:8000:8000 \
  ghcr.io/buggregator/server:latest

2. Install the SDK

bash
composer require sentry/sentry-laravel

3. Set the DSN

One line in .env. Keep the number at the end: events then go to the default project, which the UI shows from the start.

dotenv
SENTRY_LARAVEL_DSN=http://sentry@127.0.0.1:8000/1

In Docker Compose, replace 127.0.0.1 with the Buggregator service name, for example buggregator.

4. Hook it into Laravel 11 and later

Laravel 11 and later need one line in bootstrap/app.php. Without it, exceptions are not reported:

php
->withExceptions(function (Exceptions $exceptions): void {
    \Sentry\Laravel\Integration::handles($exceptions);
})

5. Throw and look

Throw an exception in a route and open the page, then open http://127.0.0.1:8000. The error shows the stack trace frame by frame with code around each line, the request method, URL and headers, the breadcrumbs before the error, tags and loaded packages.

Why it works

The Sentry SDK sends each exception over HTTP to the address in the DSN. Buggregator speaks the same protocol on port 8000, so the SDK sends to it as it would to Sentry, and Buggregator stores and shows the event. Your error handling code stays the same; only the DSN changes.

Checked on with Buggregator v2.13.0

Setup in 60 seconds

No registration. No account. Start it and point your app at it.

1

Start Buggregator

One file, installed with one command. The web UI opens on port 8000. Prefer containers? Use the Docker tab.

$ curl -fsSL https://raw.githubusercontent.com/buggregator/server/master/scripts/install.sh | sh
$ HTTP_ADDR=127.0.0.1:8000 \
  SMTP_ADDR=127.0.0.1:1025 \
  VAR_DUMPER_ADDR=127.0.0.1:9912 \
  MONOLOG_ADDR=127.0.0.1:9913 \
  PROXY_ADDR=127.0.0.1:8080 \
  ~/.local/bin/buggregator

The script picks the file for your CPU: Intel/AMD or ARM.

One file for Linux, macOS and Windows, about 40 MB. Nothing else to install.

This run line keeps it on this computer. Without the *_ADDR settings it listens on all network interfaces

Rather not run a script? Download the file yourself

Runs on Windows, macOS and Linux, on Intel/AMD and ARM.

Prefer not to do it yourself? Your AI agent can set Buggregator up for you