PHPackages                             murderxchip/trace - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [HTTP &amp; Networking](/categories/http)
4. /
5. murderxchip/trace

ActiveLibrary[HTTP &amp; Networking](/categories/http)

murderxchip/trace
=================

基于HTTP的链路日志跟踪Laravel/Lumen插件，A trace logger SDK for http request between Laravel/Lumen apps by supplying enhanced GuzzleClient implementation

1.2.2(6y ago)11140[1 issues](https://github.com/murderxchip/laravel-trace-log/issues)PHP

Since May 20Pushed 6y agoCompare

[ Source](https://github.com/murderxchip/laravel-trace-log)[ Packagist](https://packagist.org/packages/murderxchip/trace)[ RSS](/packages/murderxchip-trace/feed)WikiDiscussions master Synced 3d ago

READMEChangelogDependencies (4)Versions (4)Used By (0)

\###Lumen/Laravel 服务链路日志跟踪，采用header传递自定义trace信息方式聚合请求链路日志，本地json结构化存储方便elk采集。

使用方法：

1. 安装 项目composer.json中引入

    ```
    "repositories": [
             {
                 "type": "git",
                 "url": "https://github.com/murderxchip/laravel-trace-log.git"
             }
        ],
    ```

    "require" 字段增加

    ```
    "cactus/tracelog": "v1.0.1"
    ```

    ```
    composer update cactus/tracelog
    ```
2. 注册provider

    ```
    $app->register(\Cactus\TraceLog\TraceLogServiceProvider::class);
    ```
3. 引入middleware 在bootstrap/app.php 增加

    ```
    $app->middleware([
         \Cactus\TraceLog\TraceLogMiddleWare::class
    ]);
    ```
4. 日志路径 日志默认存储位置为 storage/logs 下 json 目录为json格式输出
5. 微服务中 guzzle 默认 Client替换为 \\Cactus\\Trace\\HttpClient 实例

    ```
    $client = new HttpClient();
    ```

    或者直接使用 app('rpcClient') 此为GuzzleClient扩展客户端，接口方法保持一直
6. 输出示例

```
{
	"message": "apilog",
	"context": {
		"apitrace": {
			"Host": "server.test",
			"Method": "GET",
			"Headers": "{\"connection\":[\"keep-alive\"],\"accept\":[\"*/*\"],\"accept-encoding\":[\"gzip, deflate\"],\"user-agent\":[\"python-requests/2.21.0\"],\"host\":[\"cactusserver-mall.test\"],\"content-length\":[\"\"],\"content-type\":[\"\"]}",
			"PathInfo": "/version",
			"QueryString": null,
			"Protocol": "HTTP/1.1",
			"IP": "127.0.0.1",
			"User-Agent": "python-requests/2.21.0",
			"Params": "[]",
			"RequestUri": "/version",
			"RequestTime": "2019-04-11 14:20:36",
			"Response": "{\"data\":{\"version\":\"Lumen (5.5.2) (Laravel Components 5.5.*)\"},\"meta\":{\"timestamp\":1554963636.89317,\"response_time\":0.0965871810913086}}",
			"Status": 200,
			"ResponseTime": "2019-04-11 14:20:36",
			"ElapseTime": "9ms"
		}
	},
	"level": 200,
	"level_name": "INFO",
	"channel": "lumen",
	"datetime": {
		"date": "2019-04-11 14:20:36.917776",
		"timezone_type": 3,
		"timezone": "Asia/Shanghai"
	},
	"extra": {
		"uid": "c36ea4f2386368c1bff60ed0"
	},
	"Trace": {
		"TraceId": "trace:15549636365caedcb4de348",
		"TraceIndex": "0.1",
		"TracePath": "/Path"
	}
}
```

Trace信息会通过header进行传递

\####ChangeLog 1.2.1 版本变更

1. trace id 精度提高
2. 修复trace index无效问题
3. response增加traceid返回

###  Health Score

29

—

LowBetter than 57% of packages

Maintenance18

Infrequent updates — may be unmaintained

Popularity17

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity62

Established project with proven stability

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~50 days

Total

3

Last Release

2498d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/5a2d41b9644ac0eb480bf5b36c4d43cb1d6a9ce096ad09dc761ef7abe8074cd4?d=identicon)[murderxchip](/maintainers/murderxchip)

---

Top Contributors

[![murderxchip](https://avatars.githubusercontent.com/u/328852?v=4)](https://github.com/murderxchip "murderxchip (3 commits)")

---

Tags

distributed-tracingguzzlehttpclientlaravelloggingmiddlewaretrace

### Embed Badge

![Health badge](/badges/murderxchip-trace/health.svg)

```
[![Health](https://phpackages.com/badges/murderxchip-trace/health.svg)](https://phpackages.com/packages/murderxchip-trace)
```

###  Alternatives

[craftcms/cms

Craft CMS

3.6k3.6M2.9k](/packages/craftcms-cms)[laravel/framework

The Laravel Framework.

34.8k543.8M19.5k](/packages/laravel-framework)[mateusjunges/laravel-kafka

A kafka driver for laravel

7253.4M20](/packages/mateusjunges-laravel-kafka)[tempest/framework

The PHP framework that gets out of your way.

2.2k31.1k12](/packages/tempest-framework)[illuminate/http

The Illuminate Http package.

11937.2M6.6k](/packages/illuminate-http)[pantheon-systems/terminus

A command line interface for Pantheon

3421.5M17](/packages/pantheon-systems-terminus)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
