swisnl/guzzle-bugsnag-breadcrumbs-middleware
Composer 安装命令:
composer require swisnl/guzzle-bugsnag-breadcrumbs-middleware
包简介
Guzzle middleware that logs Bugsnag breadcrumbs
README 文档
README
This is a middleware for Guzzle 7 that leaves Bugsnag breadcrumbs for all requests.
⚠️ Please make sure you don't log sensitive information to Bugsnag and properly configure this middleware to redact secrets. ⚠️
Install
Via Composer
composer require swisnl/guzzle-bugsnag-breadcrumbs-middleware
Usage
use Bugsnag\Client as Bugsnag; use GuzzleHttp\Client as Guzzle; use GuzzleHttp\HandlerStack; use Swis\Guzzle\Bugsnag\BreadcrumbMiddleware; $bugsnag = Bugsnag::make(); $stack = HandlerStack::create(); $stack->push(new BreadcrumbMiddleware($bugsnag)); $client = new Guzzle(['handler' => $stack]);
Now when you send a request, a Bugsnag breadcrumb is logged with the following metadata:
- method
- uri
- status code
- response body (summary), in case of client or server exceptions (status code >= 400)
- duration
Laravel
Using Laravel? Simply use the factory method to create the middleware from the Bugsnag facade: BreadcrumbMiddleware::fromFacade().
Config
You can configure the middleware using the constructor arguments:
$bugsnag
Your (preconfigured) Bugsnag client.
$name
The name of the breadcrumb.
$redactedStrings
A list of secret strings, such as API keys, that should be filtered out of the metadata.
$truncateBodyAt
The length of the response body summary, which is added to the breadcrumb in case of client or server exceptions. Use null to disable logging response/request body.
By default, it does not log the request body and only logs the response body in case of client or server exceptions (status code >= 400). If you'd like to change this behaviour, you can provide your own GuzzleHttp\BodySummarizerInterface implementation. You can use the default GuzzleHttp\BodySummarizer for example, to log all request and response bodies. Please be aware not to log sensitive information!
Change log
Please see CHANGELOG for more information on what has changed recently.
Testing
composer test
Contributing
Please see CONTRIBUTING and CODE_OF_CONDUCT for details.
Security
If you discover any security related issues, please email security@swis.nl instead of using the issue tracker.
Credits
License
The MIT License (MIT). Please see License File for more information.
This package is Treeware. If you use it in production, then we ask that you buy the world a tree to thank us for our work. By contributing to the Treeware forest you’ll be creating employment for local families and restoring wildlife habitats.
SWIS ❤️ Open Source
SWIS is a web agency from Leiden, the Netherlands. We love working with open source software.
swisnl/guzzle-bugsnag-breadcrumbs-middleware 适用场景与选型建议
swisnl/guzzle-bugsnag-breadcrumbs-middleware 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 2.7k 次下载、GitHub Stars 达 0, 最近一次更新时间为 2022 年 01 月 21 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「Guzzle」 「breadcrumbs」 「middleware」 「bugsnag」 「swisnl」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 swisnl/guzzle-bugsnag-breadcrumbs-middleware 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 swisnl/guzzle-bugsnag-breadcrumbs-middleware 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 swisnl/guzzle-bugsnag-breadcrumbs-middleware 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Shoot aims to make providing data to your templates more manageable
Breadcrumbs integration for Laravel 6
Navigation bundle for Symfony applications
Slim Framework 3 CSRF protection middleware utilities
Cloudflare Middleware For Guzzle
Simplifies working with holaluz API endpoints
统计信息
- 总下载量: 2.7k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 13
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2022-01-21