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.
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.
sentry.dsn=http://sentry@buggregator:8000/1
sentry.traces-sample-rate=1.0
sentry.logs.enabled=true4. Send one error and one log
Call the SDK once, for example from a test endpoint or a CommandLineRunner.
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.
Docs: docs.buggregator.dev/guides/spring-boot.html#errors-traces-and-logs-sentry
Requires Buggregator v2.10.0+
Related tips
- Mail
Spring Boot mail to a local inbox, two properties
Set spring.mail.host and spring.mail.port to Buggregator. Mail sent with JavaMailSender lands in a local inbox with HTML preview. Nothing is delivered.
- 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
Read Sentry Logs from PHP on your own machine
Point the Sentry PHP SDK at Buggregator with a numeric DSN and write lines with \Sentry\logger(). They show in the Logs tab locally, filtered by level.
- OpenTelemetry
Spring Boot traces from the OpenTelemetry Java agent
Attach the OpenTelemetry Java agent and point its OTLP endpoint at Buggregator. Each Spring Boot request shows as a span waterfall. No code changes.
Checked on with Buggregator v2.13.0