PHPackages                             guanguans/yii-log-target - 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. guanguans/yii-log-target

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

guanguans/yii-log-target
========================

Multiple channels of Yii exception notification(Bark、Chanify、DingTalk、FeiShu、ServerChan、WeWork、XiZhi). - 多种通道的 Yii 异常通知(Bark、Chanify、钉钉群机器人、飞书群机器人、Server 酱、企业微信群机器人、息知)。

v1.0.2(4y ago)12511MITPHPPHP &gt;=7.2CI passing

Since May 18Pushed 1w ago1 watchersCompare

[ Source](https://github.com/guanguans/yii-log-target)[ Packagist](https://packagist.org/packages/guanguans/yii-log-target)[ Docs](https://github.com/guanguans/yii-log-target)[ Fund](https://www.guanguans.cn/images/wechat.jpeg)[ RSS](/packages/guanguans-yii-log-target/feed)WikiDiscussions main Synced 3w ago

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

yii-log-target
==============

[](#yii-log-target)

[简体中文](README.md) | [ENGLISH](README-EN.md)

> Multiple channels of Yii exception notification(Bark、Chanify、DingTalk、FeiShu、ServerChan、WeWork、XiZhi). - 多种通道的 Yii 异常通知(Bark、Chanify、钉钉群机器人、飞书群机器人、Server 酱、企业微信群机器人、息知)。

[![Tests](https://github.com/guanguans/yii-log-target/workflows/Tests/badge.svg)](https://github.com/guanguans/yii-log-target/actions)[![Check & fix styling](https://github.com/guanguans/yii-log-target/workflows/Check%20&%20fix%20styling/badge.svg)](https://github.com/guanguans/yii-log-target/actions)[![codecov](https://camo.githubusercontent.com/64075d89a8bd51b78f9ae718d6123c6f49336e91a8ed329ff021f2a4df37ff80/68747470733a2f2f636f6465636f762e696f2f67682f6775616e6775616e732f7969692d6c6f672d7461726765742f6272616e63682f6d61696e2f67726170682f62616467652e7376673f746f6b656e3d55524746415753365334)](https://codecov.io/gh/guanguans/yii-log-target)[![Latest Stable Version](https://camo.githubusercontent.com/b1eb699db523b542873be28b0bdd65e24600135142a0bd2840e6d7afb2016f0b/68747470733a2f2f706f7365722e707567782e6f72672f6775616e6775616e732f7969692d6c6f672d7461726765742f76)](//packagist.org/packages/guanguans/yii-log-target)[![Total Downloads](https://camo.githubusercontent.com/f0c09d7859ab31db6eb2b585b91e496cc58b92053354584004e6392a459bb764/68747470733a2f2f706f7365722e707567782e6f72672f6775616e6775616e732f7969692d6c6f672d7461726765742f646f776e6c6f616473)](//packagist.org/packages/guanguans/yii-log-target)[![License](https://camo.githubusercontent.com/d40036f7ddea683884634a6888fbb5574d9925f8e48a81be4815a8c6efedeb38/68747470733a2f2f706f7365722e707567782e6f72672f6775616e6775616e732f7969692d6c6f672d7461726765742f6c6963656e7365)](//packagist.org/packages/guanguans/yii-log-target)

环境要求
----

[](#环境要求)

- PHP &gt;= 7.2
- yiisoft/yii2 &gt; 2.0

安装
--

[](#安装)

```
$ composer require guanguans/yii-log-target --prefer-dist -vvv
```

配置
--

[](#配置)

Yii2 配置文件 `config/main.php` 的日志组件中配置:

```
'log' => [
    'traceLevel' => YII_DEBUG ? 3 : 0,
    'targets' => [
        [
            'class' => 'yii\log\FileTarget',
            'levels' => ['error', 'warning'],
        ],

        // // Bark
        // [
        //     'class' => \Guanguans\YiiLogTarget\BarkTarget::class,
        //     'levels' => ['error'],
        //     // 'debug' => true,
        //     'token' => 'PXb8KDj9dHStfQ5cGJ5',
        // ],
        //
        // // Chanify
        // [
        //     'class' => \Guanguans\YiiLogTarget\ChanifyTarget::class,
        //     'levels' => ['error'],
        //     // 'debug' => true,
        //     'token' => 'P3IgGEiJBQVdIWlVKS1JORVY0UlVETFZYVVpRTlNLTlVZVlZPT1JFGhR7vAyf8Uj5UQhhK4n6QfVzih96QyIECAEQAQ.G4z2i0VZP7lOiCKYif4LOXu3cBdizl-PLWYn_7zrGXQ',
        // ],
        //
        // 钉钉群机器人
        [
            'class'   => \Guanguans\YiiLogTarget\DingTalkTarget::class,
            'levels'  => ['error'],
            // 'debug'   => true,
            // 'debugLogFile' => '@runtime/logs/debug-exception-target.log',
            // 'envs' => ['prod'],
            // 'excludeExceptions' => [],
            'keyword' => 'keyword',
            'token'   => 'fec1ddaa8a833156efb77b7865d62ae13775418030d94d05da08bfca73eeb',
            // 'secret'  => 'SECc32bb7345c0f73da2b9786f0f7dd5083bd768a29b82e6d460149d730eee51730',
        ],
        //
        // // 飞书群机器人
        // [
        //     'class'   => \Guanguans\YiiLogTarget\FeiShuTarget::class,
        //     'levels'  => ['error'],
        //     // 'debug'   => true,
        //     'keyword' => 'keyword',
        //     'token'   => 'b70d9-6e19-4f87-af48-348b0281866c',
        //     // 'secret'  => 'iigDOvnsIn6aFS1pYHHEHh',
        // ],
        //
        // // Server 酱
        // [
        //     'class'   => \Guanguans\YiiLogTarget\ServerChanTarget::class,
        //     'levels'  => ['error'],
        //     // 'debug'   => true,
        //     'token'   => '35149Thtf1g2Bc14QJuQ6HFpW5YGXm',
        // ],
        //
        // // 企业微信群机器人
        // [
        //     'class'   => \Guanguans\YiiLogTarget\WeWorkTarget::class,
        //     'levels'  => ['error'],
        //     // 'debug'   => true,
        //     'token'   => '3d5a3-ceff-4da8-bcf3-ff5891778fb7',
        // ],
        //
        // // 息知
        // [
        //     'class'   => \Guanguans\YiiLogTarget\XiZhiTarget::class,
        //     'levels'  => ['error'],
        //     // 'debug'   => true,
        //     'token'   => '60aea56567ae39a1b1920cbc42bb5bd',
        // ],
    ],
],
```

使用
--

[](#使用)

```
Yii::error('测试');
```

[![example](./docs/example.png)](./docs/example.png)

测试
--

[](#测试)

```
$ composer test
```

变更日志
----

[](#变更日志)

请参阅 [CHANGELOG](CHANGELOG.md) 获取最近有关更改的更多信息。

贡献指南
----

[](#贡献指南)

请参阅 [CONTRIBUTING](.github/CONTRIBUTING.md) 有关详细信息。

安全漏洞
----

[](#安全漏洞)

请查看[我们的安全政策](../../security/policy)了解如何报告安全漏洞。

贡献者
---

[](#贡献者)

- [guanguans](https://github.com/guanguans)
- [所有贡献者](../../contributors)

协议
--

[](#协议)

MIT 许可证（MIT）。有关更多信息，请参见[协议文件](LICENSE)。

###  Health Score

38

—

LowBetter than 83% of packages

Maintenance64

Regular maintenance activity

Popularity17

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity51

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 70.9% 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 ~86 days

Total

3

Last Release

1698d ago

### Community

Maintainers

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

---

Top Contributors

[![guanguans](https://avatars.githubusercontent.com/u/22309277?v=4)](https://github.com/guanguans "guanguans (56 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (22 commits)")[![ImgBotApp](https://avatars.githubusercontent.com/u/31427850?v=4)](https://github.com/ImgBotApp "ImgBotApp (1 commits)")

---

Tags

debugexceptionsnotificationsyiilogsdkservernotificationnotifieryii2yiinotifytargetdingtalkFeishuserverChanweworkBarkchanifyxiZhi

###  Code Quality

TestsPHPUnit

Static AnalysisPsalm

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/guanguans-yii-log-target/health.svg)

```
[![Health](https://phpackages.com/badges/guanguans-yii-log-target/health.svg)](https://phpackages.com/packages/guanguans-yii-log-target)
```

###  Alternatives

[guanguans/laravel-exception-notify

Monitor exception and report to the notification channels(Log、Mail、AnPush、Bark、Chanify、DingTalk、Discord、Gitter、GoogleChat、IGot、Lark、Mattermost、MicrosoftTeams、NowPush、Ntfy、Push、Pushback、PushBullet、PushDeer、PushMe、Pushover、PushPlus、QQ、RocketChat、ServerChan、ShowdocPush、SimplePush、Slack、Telegram、WeWork、WPush、XiZhi、YiFengChuanHua、ZohoCliq、ZohoCliqWebHook、Zulip).

14845.8k1](/packages/guanguans-laravel-exception-notify)[guanguans/notify

Push notification SDK(AnPush、Bark、Chanify、DingTalk、Discord、Gitter、GoogleChat、IGot、Lark、Mattermost、MicrosoftTeams、NotifyX、NowPush、Ntfy、Push、Pushback、PushBullet、PushDeer、PushMe、Pushover、PushPlus、QQ、RocketChat、ServerChan、ShowdocPush、SimplePush、Slack、Telegram、WeWork、WPush、XiZhi、YiFengChuanHua、ZohoCliq、ZohoCliqWebHook、Zulip).

687114.3k8](/packages/guanguans-notify)

PHPackages © 2026

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