This bundle adds the powerful Tracy debug tool to the Symfony2 framework.
Why is Tracy better than the Symfony build-in debugger?
- Exception stack trace contains values of all method arguments.
- Request & Response & Server environment information is displayed on the error page.
- The whole error page with full stack trace can be easily stored to some directory as HTML file (useful on production mode).
- Webmaster can be notified by email about errors that occured on the site.
See full Tracy docs and sample error page.
Tracy is a part of the Nette Framework.
- Add kutny/tracy-bundle to your composer.json.
"require": {
"kutny/tracy-bundle": "dev-master"
}
- Add KutnyTracyBundle to your application kernel
// app/AppKernel.php
public function registerBundles()
{
return array(
// ...
new Kutny\TracyBundle\KutnyTracyBundle(),
// ...
);
}
1) app.php / app_dev.php
Open web/app.php and web/app_dev.php files and add the following code before the AppKernel class is instantiated:
\Tracy\Debugger::enable();
Or force the production mode where only general server error page will be displayed to the user (read more):
\Tracy\Debugger::enable(\Tracy\Debugger::PRODUCTION);
I also recommend you to enable Tracy in a strict mode so it can handle errors of type E_NOTICE and E_WARNING too.
\Tracy\Debugger::$strictMode = true;
2) config.yml
kutny_tracy:
emails: ['errors@mycompany.com'] # error notification recipients
exceptions_directory: <directory> # optional, default directory set to %kernel.logs_dir%/exceptions
This bundle license: https://github.com/kutny/tracy-bundle/blob/master/LICENSE
Tracy debugger license: https://github.com/nette/tracy/blob/master/license.md