PHPackages                             mongdch/mon-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. mongdch/mon-log

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

mongdch/mon-log
===============

The Logger Utils for PSR-3.

1.0.6(11mo ago)02176MITPHPPHP &gt;=7.0.0

Since Sep 16Pushed 11mo ago1 watchersCompare

[ Source](https://github.com/MonGDCH/mon-log)[ Packagist](https://packagist.org/packages/mongdch/mon-log)[ Docs](http://gdmon.com/)[ RSS](/packages/mongdch-mon-log/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (1)Versions (8)Used By (6)

mon-log
=======

[](#mon-log)

基于`PSR-3`实现的高扩展性日志驱动库

### 使用

[](#使用)

#### Logger

[](#logger)

```
// 解析器
$format = new LineFormat();
// 记录器
$record = new FileRecord([
    // 日志文件大小
    'maxSize'   => 20480000,
    // 日志目录
    'logPath'   => __DIR__ . '/log',
    // 日志滚动卷数
    'rollNum'   => 3,
    // 日志名称，空则使用当前日期作为名称
    'logName'   => '',
]);

$logger = new Logger($format, $record);

// 记录日志
$logger->notice('Test notice log');
$logger->info('Test info log', ['trace' => true]);
```

#### LoggerFactiry

[](#loggerfactiry)

```
// 配置信息
$config = [
    // 通道
    'default' => [
        // 解析器
        'format'    => [
            // 类名
            'handler'   => LineFormat::class,
            // 配置信息
            'config'    => []
        ],
        // 记录器
        'record'    => [
            // 类名
            'handler'   => FileRecord::class,
            // 配置信息
            'config'    => [
                // 日志文件大小
                'maxSize'   => 20480000,
                // 日志目录
                'logPath'   => __DIR__ . '/log',
                // 日志滚动卷数
                'rollNum'   => 3,
                // 日志名称，空则使用当前日期作为名称
                'logName'   => '',
            ]
        ]
    ],
    'json' => [
        // 解析器
        'format'    => [
            // 类名
            'handler'   => JsonFormat::class,
            // 配置信息
            'config'    => []
        ],
        // 记录器
        'record'    => [
            // 类名
            'handler'   => FileRecord::class,
            // 配置信息
            'config'    => [
                'logPath'   => __DIR__ . '/log/json',
            ]
        ]
    ]
];

// 注册日志工厂
$factory = LoggerFactory::instance()->registerChannel($config);

// 记录日志
$factory->channel('default')->info('test log');
$factory->channel('json')->info('test json log');
$factory->channel()->debug('test trace log', ['trace' => true]);
```

#### extend

[](#extend)

参考 `examples/extend.php` 文件

###  Health Score

33

—

LowBetter than 75% of packages

Maintenance52

Moderate activity, may be stable

Popularity12

Limited adoption so far

Community17

Small or concentrated contributor base

Maturity47

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 54.5% 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 ~167 days

Recently: every ~249 days

Total

7

Last Release

338d ago

PHP version history (2 changes)1.0.0PHP &gt;=7.4.0

1.0.1PHP &gt;=7.0.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/f72e67ce10f7cfef428bc70ce1ec7411eb16bae10edc2cc5277b765284a46c39?d=identicon)[MonGDCH](/maintainers/MonGDCH)

---

Top Contributors

[![monton-gif](https://avatars.githubusercontent.com/u/53856623?v=4)](https://github.com/monton-gif "monton-gif (6 commits)")[![MonGDCH](https://avatars.githubusercontent.com/u/19282393?v=4)](https://github.com/MonGDCH "MonGDCH (4 commits)")[![zhaobincheng](https://avatars.githubusercontent.com/u/110520511?v=4)](https://github.com/zhaobincheng "zhaobincheng (1 commits)")

---

Tags

logpsr-3logger

### Embed Badge

![Health badge](/badges/mongdch-mon-log/health.svg)

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

###  Alternatives

[analog/analog

Fast, flexible, easy PSR-3-compatible PHP logging package with dozens of handlers.

3451.5M24](/packages/analog-analog)[inpsyde/wonolog

Monolog-based logging package for WordPress.

183617.9k7](/packages/inpsyde-wonolog)[apix/log

Minimalist, thin and fast PSR-3 compliant (multi-bucket) logger.

511.0M18](/packages/apix-log)[markrogoyski/simplelog-php

Powerful PSR-3 logging. So easy, it's simple.

2818.1k4](/packages/markrogoyski-simplelog-php)[wa72/simplelogger

Wa72SimpleLogger is a collection of very simple loggers implementing \\Psr\\Log\\LoggerInterface (PSR-3)

13246.6k13](/packages/wa72-simplelogger)

PHPackages © 2026

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