PHPackages                             hyperf-aliyun-log/aliyun-sls - 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. [Logging &amp; Monitoring](/categories/logging)
4. /
5. hyperf-aliyun-log/aliyun-sls

ActiveLibrary[Logging &amp; Monitoring](/categories/logging)

hyperf-aliyun-log/aliyun-sls
============================

AliYun SLS Log For Hyperf

v1.0.1(4y ago)166MITPHPPHP &gt;=7.2

Since Jun 10Pushed 3y ago1 watchersCompare

[ Source](https://github.com/zhz20063096/hyperf)[ Packagist](https://packagist.org/packages/hyperf-aliyun-log/aliyun-sls)[ RSS](/packages/hyperf-aliyun-log-aliyun-sls/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (2)Dependencies (11)Versions (3)Used By (0)

hyperf-aliyun-log
=================

[](#hyperf-aliyun-log)

AliYun SLS Log For Hyperf

Copyright (c) 2020 尹萌

Fixed by Ken 2021 肯

一 安装

```
composer require hyperf-aliyun-log/aliyun-sls

```

二 使用

1. 生成配置文件

```
php bin/hyperf.php vendor:publish hyperf-aliyun-log/aliyun-sls

```

2. putlog 到阿里云 sls

```
use Hyperf\Di\Annotation\Inject;
use Ym\AliyunSls\ClientInterface;

/**
* @Inject
* @var ClientInterface
*/
protected $sls;

// 注意不能有空置，如果有空值可以处理为0，否则无法压缩数据产生致命错误。
$logData = ['k1'=>v1,'k2'=>v2，……];
$this->sls->putLogs($logData);

```

3. getlog 从阿里云 sls

```
use Hyperf\Di\Annotation\Inject;
use Ym\AliyunSls\ClientInterface;

/**
* @Inject
* @var ClientInterface
*/
protected $sls;

/**
 *
 * @param string $project
 *            project name
 * @param string $logStore
 *            logstore name
 * @param integer $from
 *            the begin time
 * @param integer $to
 *            the end time
 * @param string $topic
 *            topic name of logs
 * @param string $query
 *            user defined query
 * @param integer $line
 *            query return line number
 * @param integer $offset
 *            the log offset to return
 * @param bool $reverse
 *            if reverse is set to true, the query will return the latest logs first
 */

$response = $this->sls->getLogs($project, $logstore, $from, $to, $topic, $query, $line, $offset, $reverse);
if ($response->getCount()[0] > 0) {
    foreach($response->getLogs() as $log){
        $datas[] = $log->getContents();
    }
    print_r($datas);
}

```

###  Health Score

23

—

LowBetter than 27% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity10

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity48

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

Every ~189 days

Total

2

Last Release

1607d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/a233aa0a4b26838dfbb528992c5c37f6feab16e057304b88f362f40542bba0f6?d=identicon)[zhz20063096](/maintainers/zhz20063096)

---

Top Contributors

[![zhz20063096](https://avatars.githubusercontent.com/u/39719462?v=4)](https://github.com/zhz20063096 "zhz20063096 (25 commits)")

---

Tags

phpswoolealiyunSLShyperf

###  Code Quality

TestsPHPUnit

Code StylePHP CS Fixer

### Embed Badge

![Health badge](/badges/hyperf-aliyun-log-aliyun-sls/health.svg)

```
[![Health](https://phpackages.com/badges/hyperf-aliyun-log-aliyun-sls/health.svg)](https://phpackages.com/packages/hyperf-aliyun-log-aliyun-sls)
```

PHPackages © 2026

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