cronfy/yii2-web-errorhandler
Composer 安装命令:
composer require cronfy/yii2-web-errorhandler
包简介
Yii2 customizable error handler
README 文档
README
Can be customized in terms of which error types should be converted to exceptions or only logged.
Installation
php composer.phar require cronfy/yii2-web-errorhandler
Usage
Replace errorHandler component in application configuration and configure error types you want to convert to exceptions
or log. Default is E_ALL | E_STRICT.
Example:
... 'components' => [ 'errorHandler' => [ 'class' => 'cronfy\yii\web\ErrorHandler', 'typesToExceptions' => YII_DEBUG ? (E_ALL | E_STRICT) : false, 'typesToLog' => E_ALL | E_STRICT, ], ], ...
This configuration will convert all php notices and warnings to exceptions only in debug mode, and none in production environment. Errors will be logged both in debug and production modes. You can customize error types that go to log or convereted to exceptions.
Errors are logged via internal Yii2 log component.
You can enable/disable ErrorHandler for particular error types by setting typesToHandle option. All error types not specified
there will be forwarded to internal php error handler:
... 'components' => [ 'errorHandler' => [ 'class' => 'cronfy\yii\web\ErrorHandler', 'typesToHandle' => E_ALL & ~E_NOTICE, // NOTE: although E_ALL is set here, PHP Notices will not be converted to exceptions, // because they were disabled via 'typesToHandle' option above. // PHP Warnings and other errors will be converted to exceptions. 'typesToExceptions' => E_ALL, ], ], ...
cronfy/yii2-web-errorhandler 适用场景与选型建议
cronfy/yii2-web-errorhandler 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 47.78k 次下载、GitHub Stars 达 4, 最近一次更新时间为 2016 年 10 月 06 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 cronfy/yii2-web-errorhandler 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 cronfy/yii2-web-errorhandler 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 47.78k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 4
- 点击次数: 21
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: GPL-3.0
- 更新时间: 2016-10-06