fei/logger-package
Composer 安装命令:
composer require fei/logger-package
包简介
Logger client package integration for Objective PHP applications
README 文档
README
This package provide Logger Client integration for Objective PHP applications.
Installation
Logger Package needs PHP 7.0 or up to run correctly.
You will have to integrate it to your Objective PHP project with composer require fei/logger-package.
Integration
As shown below, the Logger Package must be plugged in the application initialization method.
The Logger Package create a Logger Client service that will be consumed by the application's middlewares.
IMPORTANT : this package must be plugged at the first step (in this case, bootstrap).
<?php use ObjectivePHP\Application\AbstractApplication; use Fei\Service\Logger\Package\LoggerPackage; class Application extends AbstractApplication { public function init() { // Define some application steps $this->addSteps('bootstrap', 'init', 'auth', 'route', 'rendering'); // Initializations... // Plugging the Logger Package in the bootstrap step $this->getStep('bootstrap') ->plug(LoggerPackage::class); // Another initializations... } }
You can run this package in an other step. To do this, you just need to do something like that :
<?php use ObjectivePHP\Application\AbstractApplication; use Fei\Service\Logger\Package\LoggerPackage; class Application extends AbstractApplication { public function init() { // Define some application steps $this->addSteps('bootstrap', 'init', 'auth', 'route', 'rendering'); // Initializations... // Plugging the Logger Package in the bootstrap step $this->getStep('bootstrap') ->plug(new LoggerPackage('identifier.service', 'my.step')); // Another initializations... } }
identifier.service: represents the service name of logger (defaultlogger.client)my.step: represents the step where the service will be run, in this case, you can putinit,auth,route,rendering(defaultbootstrap)
Application configuration
Create a file in your configuration directory and put your Logger configuration as below:
<?php use Fei\ApiClient\Config\BasicTransportConfig; use Fei\ApiClient\Config\BeanstalkTransportConfig; use Fei\Service\Logger\Package\Config\LoggerClientConfig; return [ (new LoggerClientConfig('https://logger.test.flash-global.net')) ->setSyncTransportConfig(new BasicTransportConfig()) ->setAsyncTransportConfig(new BeanstalkTransportConfig('beanstalk.default')) ];
In the previous example you need to set this configuration:
LoggerClientConfig: the parameter represents the URL where the API can be contacted in order to send the logsBeanstalkTransportConfig: represents the service id of beanstalk
Please check out logger-client documentation for more information about how to use this client.
fei/logger-package 适用场景与选型建议
fei/logger-package 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 9.15k 次下载、GitHub Stars 达 0, 最近一次更新时间为 2019 年 01 月 18 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 fei/logger-package 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 fei/logger-package 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 9.15k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 3
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: proprietary
- 更新时间: 2019-01-18