PHPackages                             uuu9/php-api-log - 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. uuu9/php-api-log

ActiveLibrary

uuu9/php-api-log
================

uuu9 api log php sdk

v1.0(3y ago)020PHPPHP &gt;=7.0.12

Since Sep 29Pushed 3y ago1 watchersCompare

[ Source](https://github.com/haowenzou/uuu9-php-api-log)[ Packagist](https://packagist.org/packages/uuu9/php-api-log)[ RSS](/packages/uuu9-php-api-log/feed)WikiDiscussions main Synced 1w ago

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

uuu9-api-log
============

[](#uuu9-api-log)

依赖
--

[](#依赖)

代码参考 TODO
---------

[](#代码参考-todo)

支持框架
----

[](#支持框架)

- lumen5.3
- lumen5.4

lumen项目配置
---------

[](#lumen项目配置)

1 `composer.json` repositories节点新增

```
{
    "type": "vcs",
    "url": "git@github.com:haowenzou/uuu9-php-api-log.git"
},
{
    "type": "vcs",
    "url": "git@github.com:haowenzou/uuu9-aliyun-sdk-sls.git"
}
```

2 运行命令

```
composer require uuu9/php-api-log
```

3 `bootstrap/app.php`

```
//注册ApiLog
$app->register(Uuu9\PhpApiLog\Provider\ApiLogServiceProvider::class);
```

4 `app/Providers/AppServiceProvider.php`

```
Uuid::generate()
//修改为
Uuid::generate(4)
```

5 `.env.tp`

```
## 阿里云SLS配置 [/config/aliyun/sls/api_log]
SLS_API_LOG_ENDPOINT=null
SLS_API_LOG_ACCESS_KEY=null
SLS_API_SECRET_KEY=null
SLS_API_LOG_CURL_TIME_OUT_MS=null //默认1s(异步调用)
SLS_API_LOG_LOG_STORE=null //默认apilog
SLS_API_LOG_TOPIC={项目名称}-语言{php,java,fed,go}
SLS_API_LOG_PROJECT=null

//配置示例：IPDB项目
## 阿里云SLS配置 [/config/aliyun/sls/api_log]
SLS_API_LOG_ENDPOINT=null
SLS_API_LOG_ACCESS_KEY=null
SLS_API_SECRET_KEY=null
SLS_API_LOG_CURL_TIME_OUT_MS=null
SLS_API_LOG_LOG_STORE=null
SLS_API_LOG_TOPIC=ipdb-php
SLS_API_LOG_PROJECT=null

```

6 升级`uuu9/signature`

```
//版本 >= 0.3.1
composer update uuu9/signature
```

透传头域
----

[](#透传头域)

对于需要透传的头域，SDK通过 Cache 的方式传递给应用程序：

```
//通过此方式获取
Cache::store('array')->get('penetrateContext')
```

包含了：

- X-Request-Id
- X-Remote-Addr
- X-User-Info-UID
- X-User-Info-UA
- X-User-Info-Channel
- X-User-Info-DT
- X-Forwarded-For
- X-STA-Id
- X-Transaction-Id

如果Cache中不存在，则表明该头域不需要透传。

参考
--

[](#参考)

1. [通用API日志规范](http://git.vpgame.cn/infra/design-docs/blob/master/draft/api-log/api-log.md)

###  Health Score

20

—

LowBetter than 14% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 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

Unknown

Total

1

Last Release

1326d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/66de775505af76526a247dd082fd71fc592fec8d93a3e31d44bcee7a81eb57a5?d=identicon)[haowenzou](/maintainers/haowenzou)

---

Top Contributors

[![haowenzou](https://avatars.githubusercontent.com/u/30683389?v=4)](https://github.com/haowenzou "haowenzou (5 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/uuu9-php-api-log/health.svg)

```
[![Health](https://phpackages.com/badges/uuu9-php-api-log/health.svg)](https://phpackages.com/packages/uuu9-php-api-log)
```

PHPackages © 2026

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