PHPackages                             surest/hyperf-simple-log - 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. surest/hyperf-simple-log

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

surest/hyperf-simple-log
========================

这是一个简单日志输出包，可支简单支持配置日志信息等等

v0.14(6y ago)251MITPHP

Since Mar 15Pushed 4y agoCompare

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

READMEChangelogDependenciesVersions (8)Used By (0)

SimpleLog
---------

[](#simplelog)

这是一个运行在 hyperf框架上的 的日志输出包，可支简单支持配置日志信息等等

安装
--

[](#安装)

```
composer require 'surest/hyperf-simple-log' -vvv

```

启动
--

[](#启动)

```
php bin/hyperf.php start

```

目前支持
----

[](#目前支持)

> 默认使用 JsonFormatter 输出

1、自定义日志配置

2、文件流输出(目前只支持)

3、请求日志输出

新增配置项目
------

[](#新增配置项目)

备注：暂定

项目新增env配置

```
# 项目信息配置
SERVICE_NAME=blog
# ZLOG 日志配置
ZLOG_ENABLE=true                 # 是否开启 zlog：true、false
ZLOG_MAX_FILES=3                 # 日志文件按天轮转，指定保留多少天的业务日志
ZLOG_MIN_LEVEL=info              # 日志级别：debug、info、warn、error
ZLOG_REQUEST_ON=enable         # 是否打开请求日志输出：enable（启用）、disable（禁用）

```

发布配置文件

```
php bin/hyperf.php vendor:publish surest/hyperf-simple-log

```

发布失败情况下

```
cp vendor/surest/hyperf-simple-log/src/zlog.php ./config/autoload/zlog.php

```

新增全局中间件
-------

[](#新增全局中间件)

1、进入`config/autoload/middlewares.php`, 新增全局路由

```
Surest\SimpleLog\Middlewares\SimpleMiddleware::class

example：

    use Surest\SimpleLog\Middlewares\SimpleMiddleware;

    return [
        'http' => [
            SimpleMiddleware::class
        ],
    ];

```

使用例
---

[](#使用例)

1、默认记录所有请求日志

```
# 关闭请求日志输出
ZLOG_REQUEST_ON=disable

```

2、日志输出

```
$msg = 'dcf';
$path = __DIR__;
$logger = Logging::getZLogger('path-info');
$logger->info('path', compact('path', 'msg'));

```

输出结果:

```
> request_2020-03-15.log
{"message":"request-all","context":{"log_at":"2020-03-15T22:11:09.576Z","target_url":"http://blog/test","method":"GET","params":{"a":"1","argv":["bin/hyperf.php","start"]},"agent":"PostmanRuntime/7.23.0","module_name":"blog","server_ip":"127.0.0.1","server_port":null,"client_ip":"127.0.0.1","extra":[]},"level":200,"level_name":"INFO","channel":"request","datetime":{"date":"2020-03-15 22:11:09.576636","timezone_type":3,"timezone":"Asia/Shanghai"},"extra":[]}

> biz-path-info_2020-03-15.log
{"message":"path","context":{"path":"/var/www/html/xiaoe/hyperf-skeleton/app/Controller","msg":"dcf"},"level":200,"level_name":"INFO","channel":"path-info","datetime":{"date":"2020-03-15 22:11:09.665802","timezone_type":3,"timezone":"Asia/Shanghai"},"extra":[]}

```

备注
--

[](#备注)

目前没有深入研究，只是简单的使用`monlog`来输出一些日志 --

～～～

###  Health Score

24

—

LowBetter than 32% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity51

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

Total

6

Last Release

2245d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/71992b6fd004660307bea067d74c1fe64cd783c1bccfca1aee2db7fb72e1be9d?d=identicon)[surest-sky](/maintainers/surest-sky)

---

Top Contributors

[![surest-sky](https://avatars.githubusercontent.com/u/29169847?v=4)](https://github.com/surest-sky "surest-sky (3 commits)")

### Embed Badge

![Health badge](/badges/surest-hyperf-simple-log/health.svg)

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

###  Alternatives

[psr/log

Common interface for logging libraries

10.4k1.2B9.1k](/packages/psr-log)[itsgoingd/clockwork

php dev tools in your browser

5.9k27.6M94](/packages/itsgoingd-clockwork)[graylog2/gelf-php

A php implementation to send log-messages to a GELF compatible backend like Graylog2.

41838.2M137](/packages/graylog2-gelf-php)[bugsnag/bugsnag-psr-logger

Official Bugsnag PHP PSR Logger.

32132.5M2](/packages/bugsnag-bugsnag-psr-logger)[consolidation/log

Improved Psr-3 / Psr\\Log logger based on Symfony Console components.

15462.2M7](/packages/consolidation-log)[datadog/php-datadogstatsd

An extremely simple PHP datadogstatsd client

19124.6M15](/packages/datadog-php-datadogstatsd)

PHPackages © 2026

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