nella/monolog-tracy-bundle

This package is abandoned and no longer maintained. The author suggests using the mangoweb/monolog-tracy-handler package instead.

Tracy BlueScreen handler for Monolog - Symfony bundle

Installs: 80 283

Dependents: 0

Suggesters: 0

Security: 0

Stars: 8

Watchers: 3

Forks: 4

Open Issues: 0

Type:symfony-bundle

v2.0.3 2019-12-02 21:22 UTC

This package is auto-updated.

Last update: 2021-03-08 15:20:22 UTC


README

This package is not maintained anymore, you can use mangoweb/monolog-tracy-handler instead.

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.

Installation

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

monolog:
    handlers:
        blueScreen:
            type: tracyBlueScreen

Configuration

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
monolog_tracy:
	log_directory: %kernel.logs_dir%/tracy # default
	handler_level: DEBUG # or 100 default - you can use int or constant name
	handler_bubble: true # default
	info_items:
		- 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!

Tips

Log notices/warnings in production

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

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