aloframework/handlers
Composer 安装命令:
composer require aloframework/handlers
包简介
The error and exception handlers of AloFramework
README 文档
README
A powerful error and exception handler of AloFramework. It can automatically log errors and exceptions if an object implementing the \Psr\Log\LoggerInterface is passed on and will echo output based on your server's error reporting settings, altering its format depending on whether an error is raised during a HTTP or CLI call.
Latest release API documentation: https://aloframework.github.io/handlers/
| dev-develop | Latest release |
|---|---|
Installation
Installation is available via Composer:
composer require aloframework/handlers
Usage
- To enable the exception handler call
\AloFramework\Handlers\ExceptionHandler::register() - To enable the error handler call
\AloFramework\Handlers\ErrorHandler::register() - To enable the shutdown handler call
\AloFramework\Handlers\ShutdownHandler::register()
Logging
Every error and exception has to be logged in this package. You can supply your own logger to have more control; if you don't, aloframework/log will be used with its default settings.
Configuration
Configuration is done via the classes in the AloFramework\Handlers\Config namespace.
Common
CFG_CSS_PATH- path to the CSS file which will style the HTML output. Defaults to error.min.css in the src directory.CFG_TRACE_MAX_DEPTH- maximum number of debug backtrace items to display [50]CFG_BACKGROUND- CLI output background colour [default]CFG_FOREGROUND_NOTICE- CLI output notice level foreground colour [cyan]CFG_FOREGROUND_WARNING- CLI output warning level foreground colour [yellow]CFG_FOREGROUND_ERROR- CLI output error/exception level foreground colour [red]CFG_FORCE_HTML- Whether to force HTML output even in CLI mode [false]
Error Handlers' Config
CFG_ERROR_LEVEL- Which error levels to handle. Defaults to the value oferror_reporting().CFG_LOG_ERROR_LOCATION- Whether to include the error location in the log [true]
Exception Handlers' Config
CFG_EXCEPTION_DEPTH- Maximum number previous exceptions to output in the exception handler [10]CFG_LOG_EXCEPTION_LOCATIONWhether to include the exception location in the log [true]
aloframework/handlers 适用场景与选型建议
aloframework/handlers 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 230 次下载、GitHub Stars 达 0, 最近一次更新时间为 2015 年 09 月 19 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「php」 「exception」 「error」 「handler」 「configurable」 「shutdown」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 aloframework/handlers 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 aloframework/handlers 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 aloframework/handlers 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
PHP Error Handler module that captures and displays all throwable errors in a given format, making debugging easier and more efficient
Error and Exception override and observers.
Error handler based on Booboo with HTML and JSON support
Error Share App, for handle error page
Standard PHP Library Extension featuring an ExceptionInterface.
Alfabank REST API integration
统计信息
- 总下载量: 230
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 28
- 依赖项目数: 3
- 推荐数: 0
其他信息
- 授权协议: Apache-2.0
- 更新时间: 2015-09-19