kucera / monolog-extensions-bundle
Bundle adding a set of Monolog extensions.
Installs: 7 382
Dependents: 0
Suggesters: 0
Security: 0
Stars: 2
Watchers: 3
Forks: 5
Open Issues: 0
Requires
- php: >=5.3.2
- kucera/monolog-extensions: ~0.1.0
- symfony/config: ~2.6|~3.0
- symfony/dependency-injection: ~2.6|~3.0
- symfony/monolog-bundle: ~2.6|~3.0
- symfony/yaml: ~2.6|~3.0
Requires (Dev)
- phpunit/phpunit: ~4.1
This package is not auto-updated.
Last update: 2024-11-09 16:37:42 UTC
README
Bundle providing mainly integration of Tracy into Symfony.
Tracy capabilities
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 kucera/monolog-extensions-bundle:~0.1.0
Register Bundle
// AppKernel.php public function registerBundles() { $bundles = array( // ... new Kucera\MonologExtensionsBundle\KuceraMonologExtensionsBundle(), // what a terrible name! ); }
Register a new Monolog handler
monolog: handlers: blueScreen: type: blue screen
Profit!
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!
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); }