Tracy BlueScreen handler for Monolog - Symfony bundle


Build Status Windows Build Status Code Coverage SensioLabsInsight Status Latest Stable Version Composer Downloads Dependency Status License MIT, GPL-2, GPL-3

Sponzored by Shipito LLC.

Bundle providing mainly integration of Tracy into Symfony.

Are you looking for Monolog integration only? There is Monolog-Tracy.

Tracy - Blue Screen Handler

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 nella/monolog-tracy-bundle

Register Bundle

// AppKernel.php

public function registerBundles()
    $bundles = array(
        // ...
        new Nella\MonologTracyBundle\MonologTracyBundle(),

Register a new Monolog handler

            type: tracyBlueScreen


Any error/exception making it to the top is automatically saved in %kernel.logs_dir%/tracy. You can easily change the log directory, see full configuration options below:

# config.yml
	log_directory: %kernel.logs_dir%/tracy # default
	handler_level: DEBUG # or 100 default - you can use int or constant name
	handler_bubble: true # default
		- Symfony 3.0.1 # default if HttpKernel is present
		- Doctrine ORM 2.5.2 # default if Doctrine ORM is present
		- Twig 1.23.1 # default if Twig is present
	panels: # no default panels
		- test.nella.monolog_tracy_bundle.panel.test_panel # callable ([class, method], [@service, method], @service, class::service)
	collapse_paths: # no default collapse paths
		- %kernel.root_dir%/vendor # TIP

This works out of the box and also in production mode!


Log notices/warnings in production

Use Symfony parameter debug.error_handler.throw_at: (see for possible values)

    debug.error_handler.throw_at: -1

Using Tracy\Debugger::dump

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);