nella / monolog-tracy-bundle
Tracy BlueScreen handler for Monolog - Symfony bundle
Installs: 77 904
Dependents: 0
Suggesters: 0
Security: 0
Stars: 8
Watchers: 3
Forks: 4
Open Issues: 0
Type:symfony-bundle
Requires
- php: ~7.2
- nella/monolog-tracy: ~2.0
- symfony/config: ^4.3|^5.0
- symfony/dependency-injection: ^4.3|^5.0
- symfony/expression-language: ^4.3|^5.0
- symfony/monolog-bundle: ~3.0
- symfony/yaml: ^4.3|^5.0
Requires (Dev)
- doctrine/orm: 2.6.0
- jakub-onderka/php-console-highlighter: 0.3.2
- jakub-onderka/php-parallel-lint: 0.9.2
- matthiasnoback/symfony-dependency-injection-test: 2.3.0
- nella/coding-standard: 4.2.1
- phing/phing: 2.16.1
- phpunit/phpunit: 6.5.6
- twig/twig: 2.4.4
Conflicts
- symfony/console: <4.0
- symfony/debug: <4.0
- symfony/event-dispatcher: <4.0
- symfony/filesystem: <4.0
- symfony/http-foundation: <4.0
- symfony/http-kernel: <4.0
README
This package is not maintained anymore, you can use mangoweb/monolog-tracy-handler instead.
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); }