Symfony dump server output in a browser tab
Instead of running bin/console server:dump in a terminal, use Buggregator as the dump server. Set VAR_DUMPER_FORMAT=server and VAR_DUMPER_SERVER=127.0.0.1:9912 in .env.local. Every dump() then shows up in a browser tab as a tree you can fold, with the file and line it came from. Your page and your JSON responses stay clean.
Steps
1. Start Buggregator
Port 8000 is the UI, port 9912 takes the dumps.
docker run --pull always \
-p 127.0.0.1:8000:8000 \
-p 127.0.0.1:9912:9912 \
ghcr.io/buggregator/server:latest2. Set two lines in .env.local
In Docker Compose, use the service name: VAR_DUMPER_SERVER=buggregator:9912.
VAR_DUMPER_FORMAT=server
VAR_DUMPER_SERVER=127.0.0.1:9912You do not run server:dump. Buggregator listens on port 9912 in its place.
3. Or use the debug bundle's setting
If you use symfony/debug-bundle, its recipe adds config/packages/debug.yaml with a dump destination that reads VAR_DUMPER_SERVER. Then set only VAR_DUMPER_SERVER.
when@dev:
debug:
dump_destination: "tcp://%env(VAR_DUMPER_SERVER)%"4. Call dump() as usual
Open http://127.0.0.1:8000. Each dump shows the value as an expandable tree, its label if you gave one, and the source location. Click the location to open the file in your editor. This also works in commands, Messenger workers and other long-running processes.
Why it works
With VAR_DUMPER_FORMAT=server, VarDumper sends each dump over TCP to VAR_DUMPER_SERVER instead of printing it. The variable also keeps the debug bundle from replacing that handler, so dumps go to Buggregator and not into the page. Buggregator renders what arrives on port 9912. On the Windows binary, the VarDumper module is not available.
Related tips
- Dumps
dump() without breaking your page or JSON response
Send Symfony VarDumper output to Buggregator with two env vars. dump() stops landing in your HTML or JSON and shows the file and line it came from.
- Dumps
Dump from any PHP script with Trap, no Docker
Add buggregator/trap with Composer, run vendor/bin/trap --ui and call trap() in a plain PHP script. Dumps show in a local web UI, not in your output.
- Logs
Symfony logs in a live view, context as JSON
Add one Monolog socket handler with the JSON formatter, and your Symfony logs appear live in Buggregator with channel, level and context.
- Sentry
Symfony errors in a Sentry-style view, no account
Install sentry/sentry-symfony, turn it on for dev and set SENTRY_DSN to Buggregator. Exceptions show with stack trace, request and breadcrumbs.
Checked on with Buggregator v2.13.0