fei/logger-package 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

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 (default logger.client)
  • my.step : represents the step where the service will be run, in this case, you can put init, auth, route, rendering (default bootstrap)

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 logs
  • BeanstalkTransportConfig : 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 我们能提供哪些服务?
定制开发 / 二次开发

基于 fei/logger-package 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

  • 总下载量: 9.15k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 3
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 21
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: proprietary
  • 更新时间: 2019-01-18