nella / monolog-tracy-bundle
v2.0.3
2019-12-02 21:22 UTC
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
该软件包不再维护,您可以使用mangoweb/monolog-tracy-handler代替。
由Shipito LLC赞助。
您正在寻找仅集成Monolog的工具吗?这里有Monolog-Tracy。
Tracy - 蓝屏处理器
简而言之,当发生错误时,Tracy可以帮助您调试应用程序,提供大量关于刚刚发生的事情的信息。查看实时示例和Tracy 文档以了解此工具的全部功能。
要替换默认的 Symfony 蓝屏,您可以使用完全兼容此库的Tracy Bluescreen 扩展包。
安装
使用Composer
$ composer require nella/monolog-tracy-bundle
注册扩展包
// AppKernel.php public function registerBundles() { $bundles = array( // ... new Nella\MonologTracyBundle\MonologTracyBundle(), ); }
注册新的 Monolog 处理器
monolog: handlers: blueScreen: type: tracyBlueScreen
配置
任何到达顶层的错误/异常都将自动保存在 %kernel.logs_dir%/tracy
中。您可以轻松更改日志目录,下面是完整的配置选项
# 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
它默认工作,也可在生产模式下使用!
提示
在生产中记录通知/警告
使用 Symfony 参数 debug.error_handler.throw_at
:(有关可能的值,请参阅https://php.ac.cn/manual/en/function.error-reporting.php)
parameters: debug.error_handler.throw_at: -1
使用 Tracy\Debugger::dump
要防止在生产中出现忘记的输出,您可以简单地更改模式,如下所示
// AppKernel.php use Tracy\Debugger; public function __construct($environment, $debug) { Debugger::$productionMode = $environment === 'prod'; parent::__construct($environment, $debug); }