PHPackages                             qingbing/zf-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. qingbing/zf-log

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

qingbing/zf-log
===============

日志组件，日志的相关操作

1.0.1(6y ago)02MITPHPPHP &gt;=7.0.0

Since Apr 12Pushed 6y ago1 watchersCompare

[ Source](https://github.com/qingbing/zf-log)[ Packagist](https://packagist.org/packages/qingbing/zf-log)[ Docs](http://www.phpcorner.net)[ RSS](/packages/qingbing-zf-log/feed)WikiDiscussions master Synced today

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

zf-log
======

[](#zf-log)

日志组件，日志的相关操作

提示
==

[](#提示)

- 日志级别完全参考 "\\Psr\\Log\\LogLevel"
- 日志可以使用多个处理机，默认使用 "new FileFlusher(new Formatter())"
- 支持自定义 Flusher 和 Formatter，需要继承 "\\Zf\\Log\\Supports\\Abstracts\\AFlusher" 和 "\\Zf\\Log\\Supports\\Abstracts\\AFormatter"
- 日志提供8个级别的日志记录

使用默认的 flusher
=============

[](#使用默认的-flusher)

```
$logger = Object::create([
    'class' => Logger::class,
    'channel' => 'log'
]);
/* @var Logger $logger */
$logger->emergency('I am emergency.');
$logger->alert('I am alert.');
$logger->critical('I am critical.');
$logger->error('I am error.');
$logger->warning('I am warning.');
$logger->notice('I am notice.');
$logger->info('I am info.');
$logger->debug('I am debug.');
```

使用自定义的Flusher和Formatter
=======================

[](#使用自定义的flusher和formatter)

```
$logger = Object::create([
    'class' => Logger::class,
    'channel' => 'log'
]);
/* @var Logger $logger */
// 文件日志处理机
$flusher = new FileFlusher(new Formatter());
$flusher->acceptTypes = [
    Logger::INFO,
    Logger::WARNING,
    Logger::CRITICAL,
];
$logger->addFlusher($flusher);

// 流式日志处理
$flusher = new StreamFlusher(new class extends AFormatter
{
    /**
     * @describe    格式化一个日志记录
     *
     * @param array $record
     *
     * @return mixed
     */
    public function format(array $record)
    {
        return json_encode($record, JSON_UNESCAPED_UNICODE);
    }
});
$flusher->acceptTypes = [
    Logger::WARNING,
    Logger::CRITICAL,
];
// 流式消息处理机
$logger->addFlusher($flusher);

$logger->emergency('I am emergency.');
$logger->alert('I am alert.');
$logger->critical('I am critical.');
$logger->error('I am error.');
$logger->warning('I am warning.');
$logger->notice('I am notice.');
$logger->info('I am info.');
$logger->debug('I am debug.');
```

###  Health Score

22

—

LowBetter than 22% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity2

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

Unknown

Total

1

Last Release

2219d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/9379d2ee4885074de75faa3fa12970614186826f762df3c4aa0905dc1ff3b513?d=identicon)[qingbing](/maintainers/qingbing)

---

Top Contributors

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

---

Tags

logphpzf

### Embed Badge

![Health badge](/badges/qingbing-zf-log/health.svg)

```
[![Health](https://phpackages.com/badges/qingbing-zf-log/health.svg)](https://phpackages.com/packages/qingbing-zf-log)
```

###  Alternatives

[opengento/module-webapi-logger

This module allows you to analyze all the webapi rest done call toward your Magento.

1014.9k](/packages/opengento-module-webapi-logger)

PHPackages © 2026

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