Repository navigation
Symfony
composer require shibbirweb/peep --devpeep() works right away in controllers, services and commands once Peep is on (PEEP_ENABLED=true in .env.local, or a peep.php file in the project root). The setup below adds logs, dump() and values shown with VarDumper's casters.
Register the handler as a service in config/services_dev.yaml (or in config/services.yaml under when@dev:):
services:
peep.monolog_handler:
class: Monolog\Handler\AbstractProcessingHandler
factory: ['ShibbirWeb\Peep\Bridge\Monolog\PeepHandlerFactory', 'create']
arguments: ['debug']Then use it in config/packages/dev/monolog.yaml (or under when@dev: in config/packages/monolog.yaml):
monolog:
handlers:
peep:
type: service
id: peep.monolog_handler
channels: ['!event', '!doctrine']Every log record of the selected channels now shows in Peep, and a logged exception ($logger->error('...', ['exception' => $e])) is shown as an exception card.
Symfony's DebugBundle sends dump() to the profiler. Register Peep's handler after the bundles have booted, so the profiler keeps getting the dumps too. In src/Kernel.php:
public function boot(): void
{
parent::boot();
if ($this->getEnvironment() === 'dev') {
\ShibbirWeb\Peep\Bridge\VarDumper\DumpHandler::register();
}
}Peep's own serializer never calls code on the values it shows. To get VarDumper's casters (Doctrine proxies, DateTime, DOM, Intl and more), switch the serializer in peep.php:
return [
'enabled' => true,
'serializer' => 'var-dumper',
];Casters can call methods on the values (a Doctrine proxy may load itself), which is why this is opt-in.
Symfony already handles errors and exceptions. They reach Peep through the Monolog handler above (the request and php channels log every exception). There is no need for Peep's own ErrorHandler in a Symfony app.
This wiki is written in docs/wiki; change it there by pull request.
Using Peep
- Getting Started
- Installation
- Version Support
- Configuration
- The Viewer
- API Reference
- API Values
- API Inspecting
- API Control
- API Laravel
- Laravel
- Query Debugging
- Plain PHP
- Symfony
- Slim
- WordPress
- Global Install
- Mail and SMS
- Webhooks
- Logs
- Desktop App
- Finding Leftover Calls
- AI Agents
- Troubleshooting
Working on Peep