Download the PHP package nango/swoft-tracker without Composer
On this page you can find all versions of the php package nango/swoft-tracker. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Table of contents
Download nango/swoft-tracker
More information about nango/swoft-tracker
Files in nango/swoft-tracker
Download nango/swoft-tracker
More information about nango/swoft-tracker
Files in nango/swoft-tracker
Please rate this library. Is it a good library?
Informations about the package swoft-tracker
swoft-tracker
该库主要通过设置traceid,spanid,来实现日志链路记录,保证同一请求的链路traceid一致;
并且增加RedisHandler
可以将日志直接记录到redis中(协程方式),后续可以通过ELK同步日志;另外通过日志配置增加version、interface、method、params、cost(时间消耗)的日志记录
要求
该库的日志记录级别为info
,请打开相关日志级别记录。
用法
配置
在bean.php
文件中进行配置;
如果应用只提供RPC服务,则需要在bean.php中添加,RPC中间件来记录相关日志;如下:
如果应用需要对外提供HTTP服务,并且内部需要通过RPC调用其他微服务的话,则需要在bean.php中进行以下配置:
首先增加HTTP中间件:
另外,RPC CLient增加extender
配置:
以上配置就可以实现,多服务之间调用时的日志链路追踪。
logger配置
使用RedisHandler
,可以指定连接池,将业务redis库和日志库隔离开;简单配置如下:
非swoft框架 RPC调用
如果需要在非swoft框架中通过RPC调用swoft的微服务的话,需要在ext
中增加traceid
参数,如下:
All versions of swoft-tracker with dependencies
PHP Build Version
Package Version
No informations.
The package nango/swoft-tracker contains the following files
Loading the files please wait ....