PHPackages                             nyg/ali\_sls\_tp5 - 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. nyg/ali\_sls\_tp5

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

nyg/ali\_sls\_tp5
=================

Aliyun sls log driver for thinkphp 5.0

1.0.5(5y ago)012MITPHPPHP &gt;=7.1

Since Jan 10Pushed 5y ago1 watchersCompare

[ Source](https://github.com/nyg123/ali_sls_tp5)[ Packagist](https://packagist.org/packages/nyg/ali_sls_tp5)[ RSS](/packages/nyg-ali-sls-tp5/feed)WikiDiscussions master Synced today

READMEChangelog (8)Dependencies (3)Versions (9)Used By (0)

#### 说明

[](#说明)

扩展tp5.0的日志驱动，只需简单配置，即可把日志上传至阿里云日志服务。上传失败时会自动保存到本地，不影响系统运行

#### 安装

[](#安装)

> composer require nyg/ali\_sls\_tp5

#### 配置config.php

[](#配置configphp)

```
[
'log'                    => [
        // 日志记录方式，内置 file socket 支持扩展
        #'type'  => 'File',
        #日志驱动改为Sls
        'type' => 'Sls',
        # 阿里云sls公网域名，阿里云的主机可以用内网
        'endpoint' => 'cn-qingdao.log.aliyuncs.com',
        # 阿里云账号和密钥
        'access_key_id' => '',
        'access_key_secret' => '',
        # 项目（Project）是日志服务中的资源管理单元
        'project' => 'php-log-test',
        # 日志库（Logstore）是日志服务中日志数据的采集、存储和查询单元
        'logstore' => '',

        # 可选配置
        # 默认记录详细的日志信息，如果不想记录细节可以设置为false
        'more_info'=>true,

        'source'=>'',

        // 日志记录级别
        'level' => [],
        // 日志单独记录
        'apart_level' => [],
    ]
 ]
```

到这里就可以正常使用了，和使用框架自带的log驱动用法是一样的

#### 附录

[](#附录)

1,统计各接口响应时间和错误次数的查询语句，可以生成仪表盘

> `* | SELECT uri as "接口地址", COUNT(*) as "请求数",avg(runtime) as "平均响应时间",max(runtime) as "最大响应时间",count_if(msg like '%[ error ]%') as "错误数",date_format(max(__time__),'%Y-%m-%d %H:%i:%S') as "最近请求" GROUP BY uri ORDER BY "最近请求" DESC  LIMIT 20`

###  Health Score

24

—

LowBetter than 31% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity5

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity54

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

Total

8

Last Release

1982d ago

Major Versions

0.0.2 → 1.0.02021-01-11

### Community

Maintainers

![](https://www.gravatar.com/avatar/034ee0bcfafe1b9e0d463b779f1fcc2177a5f651ce370b5d3686c13304281224?d=identicon)[牛永光](/maintainers/%E7%89%9B%E6%B0%B8%E5%85%89)

---

Top Contributors

[![nyg123](https://avatars.githubusercontent.com/u/30823967?v=4)](https://github.com/nyg123 "nyg123 (9 commits)")

---

Tags

logaliyunSLSthinkphp5tp5.0

### Embed Badge

![Health badge](/badges/nyg-ali-sls-tp5/health.svg)

```
[![Health](https://phpackages.com/badges/nyg-ali-sls-tp5/health.svg)](https://phpackages.com/packages/nyg-ali-sls-tp5)
```

###  Alternatives

[lokielse/laravel-sls

Aliyun SLS Log For Laravel

213.7k](/packages/lokielse-laravel-sls)

PHPackages © 2026

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