Skip to main content

Spring Boot errors through the Sentry Java SDK, locally

Add the Sentry starter for your Spring Boot version and set sentry.dsn=http://sentry@buggregator:8000/1 in a local profile. Exceptions, traces and logs from the Sentry Java SDK then land in Buggregator on your machine, with stack traces and the trace waterfall. No Sentry account is needed.

Steps

1. Add Buggregator to your Compose file

Under services: in docker-compose.yml or compose.yaml. Your app container reaches it by the service name buggregator.

yaml
  buggregator:
    image: ghcr.io/buggregator/server:latest
    ports:
      - "127.0.0.1:8000:8000"

If the app runs on your machine (./mvnw spring-boot:run or your IDE), use 127.0.0.1 instead of buggregator below.

2. Add the Sentry starter

Pick the artifact for your Spring Boot version. Use the same version as the Sentry SDK.

Spring Boot Artifact
4.x io.sentry:sentry-spring-boot-4-starter
3.x io.sentry:sentry-spring-boot-starter-jakarta

3. Point it at Buggregator

Put these lines in a local profile, for example application-local.properties, so they never reach production. The sample rate of 1.0 sends every trace.

properties
sentry.dsn=http://sentry@buggregator:8000/1
sentry.traces-sample-rate=1.0
sentry.logs.enabled=true

4. Send one error and one log

Call the SDK once, for example from a test endpoint or a CommandLineRunner.

java
Sentry.logger().info("Hello from Spring Boot");
Sentry.captureException(new IllegalStateException("Check error"));

Open http://127.0.0.1:8000. The error «Check error» shows with its stack trace. The log is on the Sentry page, Logs tab. Traces are on the Traces tab.

Why it works

The Sentry Java SDK sends its data to the host in the DSN. Buggregator accepts the Sentry protocol on port 8000 and stores errors, transactions and logs instead of forwarding them.

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