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

ActiveLibrary

wish-cloud/aliyun-sls
=====================

The PHP SDK of Aliyuncs SLS log service

v1.0.0(10mo ago)2537↓100%MITPHPPHP &gt;=7.2

Since Jul 8Pushed 10mo agoCompare

[ Source](https://github.com/wish-cloud/aliyun-sls)[ Packagist](https://packagist.org/packages/wish-cloud/aliyun-sls)[ RSS](/packages/wish-cloud-aliyun-sls/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (1)Dependencies (1)Versions (2)Used By (0)

Aliyun Log Service PHP SDK
==========================

[](#aliyun-log-service-php-sdk)

Introduction
------------

[](#introduction)

Log Service SDK for Aliyun Log Service([www.aliyun.com/product/sls](http://www.aliyun.com/product/sls)).

由于官网提供的 [PHP SDK](https://github.com/aliyun/aliyun-log-php-sdk) 存在一些使用不便，暂时单独发布一份支持 composer 支持命名空间的版本.

安装方法
----

[](#安装方法)

```
composer require wish-cloud/aliyun-sls
```

使用示例
----

[](#使用示例)

日志查询:

```
use Wish\AliyunSls\Client;
use Wish\AliyunSls\Models\Request\GetLogsRequest;

...

$endpoint = 'http://cn-qingdao.log.aliyuncs.com';
$accessKeyId = 'xxxxxx';
$accessKey = 'xxxxxx';
$project = 'project-name';
$logstore = 'logstore-name';

// 日志主题 https://help.aliyun.com/zh/sls/topic
$topic = '';
// 时间段
$from = strtotime('2025-06-01 00:00:00');
$to = strtotime('2025-06-01 23:59:59');
//查询语句，可留空。参考 https://help.aliyun.com/zh/sls/query-syntax/
$query = '* | SELECT status, count(*) AS PV GROUP BY status';

$request = new GetLogsRequest($project, $logstore, $from, $to, $topic, $query, 100, 0, False);
try {
    $response = $client->getLogs($request);
    foreach($response -> getLogs() as $log)
    {
        echo 'time:' . $log -> getTime() . ' ';
        foreach($log -> getContents() as $key => $value){
            echo $key.":".$value . ' ';
        }
        echo "";
    }
} catch (\Exception $e) {
    //
}
```

###  Health Score

29

—

LowBetter than 60% of packages

Maintenance54

Moderate activity, may be stable

Popularity16

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity31

Early-stage or recently created project

 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

306d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/796b481a8b251a90fb280302e2f0cca08a49a52648d23aac1935f9e0bb709807?d=identicon)[wish-cloud](/maintainers/wish-cloud)

---

Top Contributors

[![wish-cloud](https://avatars.githubusercontent.com/u/62369484?v=4)](https://github.com/wish-cloud "wish-cloud (1 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

PHPackages © 2026

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