Bundle providing mainly integration of Tracy into Symfony.
Long story short, Tracy helps you debug your applications when an error occurs providing you lots of information about what just happened. Check out live example and Tracy documentation to see the full power of this tool.
To replace default Symfony Bluescreen you can use Tracy Bluescreen Bundle fully compatible with this library.
Using Composer:
$ composer require kucera/monolog-extensions-bundle:~0.1.0
// AppKernel.php
public function registerBundles()
{
$bundles = array(
// ...
new Kucera\MonologExtensionsBundle\KuceraMonologExtensionsBundle(), // what a terrible name!
);
}
monolog:
handlers:
blueScreen:
type: blue screen
Any error/exception making it to the top is automatically saved in %kernel.logs_dir%/blueScreen
. You can easily change the log directory,
see full configuration options below:
# config.yml
monolog:
handlers:
blueScreen:
type: blue screen
path: %kernel.logs_dir%/blueScreen # must exist
level: debug
bubble: true
This works out of the box and also in production mode!
Use Symfony parameter debug.error_handler.throw_at
: (see http://php.net/manual/en/function.error-reporting.php for possible values)
parameters:
debug.error_handler.throw_at: -1
To prevent forgotten dumps to appear on production you can simply change the mode like this:
// AppKernel.php
use Tracy\Debugger;
public function __construct($environment, $debug)
{
Debugger::$productionMode = $environment === 'prod';
parent::__construct($environment, $debug);
}