filisko/tracy-redbean
Composer 安装命令:
composer require filisko/tracy-redbean
包简介
RedBeanPHP queries logger panel for Tracy
README 文档
README
Result
Installation and configuration
Install it via composer:
composer require filisko/tracy-redbean
To make this work you must enable RedBean's debug mode to log your queries. You can simply use RedBean's Facade debug() method.
How to use
Basic example
To use this logger with any application, you could basically do something like that:
R::setup('mysql:host=hostname;dbname=db', 'username', 'password'); /* Possible log modes: ------------------- 0 Log and write to STDOUT classic style (default) 1 Log only, class style 2 Log and write to STDOUT fancy style 3 Log only, fancy style (it works nicely with this one) */ R::debug(true, 3); // ... your queries here ... // Get RedBean's Logger $logger = R::getLogger(); // Create new instance of the panel $panel = new \Filisko\Tracy\RedBeanBarPanel($logger); // Boot the panel (collect and show the panel) \Filisko\Tracy\RedBeanBarPanel::boot($panel);
Middleware example
If you are using some framework that works with PSR-7, you could use the logger like that:
// Get RedBean's Logger $logger = R::getLogger(); // Create new instance of the panel $panel = new \Filisko\Tracy\RedBeanBarPanel($logger); // Add to middleware $app->add(new \Filisko\Tracy\RedBeanBarPanelMiddleware($panel));
Extras
If you realized that RedBean puts at the end of your SQL queries something like '--keep-cache' for internal caching purposes and you want to hide this part from the logger, you could simply use a static flag to disable it:
\Filisko\Tracy\RedBeanBarPanel::$showKeepCache = false; // That's all!
If you would like to change the little icon of the panel or the title, use the provided static variables:
\Filisko\Tracy\RedBeanBarPanel::$icon = 'src/path/icon.png'; \Filisko\Tracy\RedBeanBarPanel::$title = 'RedBean query logger';
You can have a look to RedBean's website debugging page to understand a little bit better the examples.
filisko/tracy-redbean 适用场景与选型建议
filisko/tracy-redbean 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 21 次下载、GitHub Stars 达 3, 最近一次更新时间为 2016 年 05 月 18 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「logger」 「panel」 「redbean」 「tracy」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 filisko/tracy-redbean 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 filisko/tracy-redbean 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 filisko/tracy-redbean 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Workflow logger
HTTP request logger middleware for Laravel
Yii2 panel widget
A Laravel Admin Package for The Control Group to make your life easier and steer your project in the right direction
High-performance, zero-dependency PSR-3 logger for MonkeysLegion with structured logging, handlers, processors, and PHP 8.4 features.
Programmatic and database agnostic SQL helper for RedBean delivered as a plugin.
统计信息
- 总下载量: 21
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 3
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2016-05-18