PHPackages                             aston/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. aston/aliyun-sls

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

aston/aliyun-sls
================

AliYun SLS Log For Hyperf

v2.0.1(2y ago)3581MITPHPPHP &gt;=7.2

Since Jul 5Pushed 2y ago1 watchersCompare

[ Source](https://github.com/AstonChenDev/hyperf-aliyun-sls)[ Packagist](https://packagist.org/packages/aston/aliyun-sls)[ RSS](/packages/aston-aliyun-sls/feed)WikiDiscussions master Synced today

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

hyperf-aliyun-sls
=================

[](#hyperf-aliyun-sls)

hyperf框架使用的阿里云日志写入与读取

可指定通过多个sls配置读取与写入

require：

"hyperf/guzzle": "^2.0.0", "hyperf/contract": "^2.0.0", "psr/container": "^1.0|^2.0", "php": "&gt;=7.2", "ext-zlib": "*", "ext-json": "*"

安装
--

[](#安装)

使用 composer

```
composer require aston/aliyun-sls

```

发布配置文件

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

```

配置文件说明
------

[](#配置文件说明)

```
return [
    'write_switch' => (bool)env('WRITE_SLS', true),//写日志开关
    //默认日志配置组
    'default' => [
        'endpoint' => env('ALIYUN_SLS_ENDPOINT'),
        'access_key' => env('ALIYUN_SLS_AK'),
        'secret_key' => env('ALIYUN_SLS_SK'),
        'project' => env('ALIYUN_SLS_PROJECT'),
        'logstore' => env('ALIYUN_SLS_LOGSTORE'),
    ],
    //自定义日志配置组 可选
    'another' => [
        'endpoint' => env('ANOTHER_ALIYUN_SLS_ENDPOINT'),
        'access_key' => env('ANOTHER_ALIYUN_SLS_AK'),
        'secret_key' => env('ANOTHER_ALIYUN_SLS_SK'),
        'project' => env('ANOTHER_ALIYUN_SLS_PROJECT'),
        'logstore' => env('ANOTHER_ALIYUN_SLS_LOGSTORE'),
    ]
];
```

使用方法演示
------

[](#使用方法演示)

```
use Aston\AliyunSls\Logger;

//通过默认日志配置 写入
Logger::instance()->write('testLog', [
    'is_test' => 1
]);
//等价于
Logger::instance('default')->write('testLog', [
    'is_test' => 1
]);

//通过指定日志配置 读取
$log = Logger::instance('another')->read(
   $start_timestamp,
   $end_timestamp,
   $topic,
   '* |SELECT "message.customer_user_id" limit 1'
);
```

###  Health Score

23

—

LowBetter than 26% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity13

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity44

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 ~463 days

Total

2

Last Release

995d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/2635c390557e9de20d0e6f65a286f6c07201d5c65a287cea0a49e6c2b3480d1a?d=identicon)[AstonChen](/maintainers/AstonChen)

---

Top Contributors

[![AstonChenDev](https://avatars.githubusercontent.com/u/45387979?v=4)](https://github.com/AstonChenDev "AstonChenDev (1 commits)")

###  Code Quality

TestsPHPUnit

Code StylePHP CS Fixer

### Embed Badge

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

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

###  Alternatives

[symfony/symfony

The Symfony PHP framework

31.4k87.2M2.2k](/packages/symfony-symfony)[api-platform/core

Build a fully-featured hypermedia or GraphQL API in minutes!

2.6k51.2M337](/packages/api-platform-core)[spatie/flare-client-php

Send PHP errors to Flare

177161.5M22](/packages/spatie-flare-client-php)[moonshine/moonshine

Laravel administration panel

1.3k253.1k81](/packages/moonshine-moonshine)[tempest/framework

The PHP framework that gets out of your way.

2.2k34.4k15](/packages/tempest-framework)[api-platform/state

API Platform state interfaces

274.9M134](/packages/api-platform-state)

PHPackages © 2026

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