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

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

guoguo882010/aliyun-sls
=======================

阿里云 sls 日志存储

1.0.1(8mo ago)046MITPHPPHP &gt;=7.1.7

Since Aug 25Pushed 8mo agoCompare

[ Source](https://github.com/guoguo882010/aliyun-sls)[ Packagist](https://packagist.org/packages/guoguo882010/aliyun-sls)[ RSS](/packages/guoguo882010-aliyun-sls/feed)WikiDiscussions master Synced yesterday

READMEChangelogDependencies (1)Versions (3)Used By (0)

阿里云 SLS 日志
==========

[](#阿里云-sls-日志)

**安装**

```
composer require guoguo882010/aliyun-sls
```

**使用**

```
$config = [
    //服务接入点 https://help.aliyun.com/zh/sls/developer-reference/api-sls-2020-12-30-endpoint?spm=a2c4g.11186623.help-menu-28958.d_9_2_1.a0557b7czYrsET&scm=20140722.H_2771272._.OR_help-T_cn~zh-V_1

    'endpoint' => 'http://cn-chengdu-intranet.log.aliyuncs.com',

    //秘钥 id
    'accessKeyId' => 'key id',

    //秘钥 密码
    'accessKeySecret' => 'key secret',

    //项目名称
    'project'         => 'log-service',

    //存储仓库名称
    'logStore'        => 'store',

    //是否关闭写入日志
    'close'           => false
];

$sls = new \RSHDSDK\ALiYunSLS\ALiYunSLS($config);

//需要记录的日志
$data = [
    'name' => '名字',
    'age' => '12',
    //数组会转换为 json 格式存入 sls
    'address' => [
        '地址一' => '北京市',
        '地址二' => '成都市',
    ],
];

//主题，可以理解为分类，对日志进行分类
$topic = '主题';

//写入日志
$sls->putDataLog($data,$topic);

//查询日志
$sls->getLogs('主题','开始时间戳','结束时间戳','sls查询语句','每页显示数，最大100','第几页','根据日志时间、正序排序 false 倒序排序 true 默认 true')
```

###  Health Score

28

—

LowBetter than 52% of packages

Maintenance59

Moderate activity, may be stable

Popularity8

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity32

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

Every ~55 days

Total

2

Last Release

258d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/9b57028d0ae01c0a3e0a63cf818bff6b9d6ec8f8b92c506ac6a344d42e1dfea8?d=identicon)[gk](/maintainers/gk)

---

Top Contributors

[![guoguo882010](https://avatars.githubusercontent.com/u/3445260?v=4)](https://github.com/guoguo882010 "guoguo882010 (2 commits)")

### Embed Badge

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

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

###  Alternatives

[psr/log

Common interface for logging libraries

10.4k1.2B11.6k](/packages/psr-log)[open-telemetry/api

API for OpenTelemetry PHP.

1941.5M278](/packages/open-telemetry-api)[open-telemetry/sdk

SDK for OpenTelemetry PHP.

2328.5M344](/packages/open-telemetry-sdk)

PHPackages © 2026

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