Code Monkey home page Code Monkey logo

yii-log-target's Introduction

yii-log-target

简体中文 | ENGLISH

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

Tests Check & fix styling codecov Latest Stable Version Total Downloads License

环境要求

  • PHP >= 7.2
  • yiisoft/yii2 > 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

测试

$ composer test

变更日志

请参阅 CHANGELOG 获取最近有关更改的更多信息。

贡献指南

请参阅 CONTRIBUTING 有关详细信息。

安全漏洞

请查看我们的安全政策了解如何报告安全漏洞。

贡献者

协议

MIT 许可证(MIT)。有关更多信息,请参见协议文件

yii-log-target's People

Contributors

guanguans avatar dependabot[bot] avatar imgbotapp avatar

Stargazers

vartrue avatar  avatar  avatar  avatar  avatar Jcoder avatar  avatar pltrue avatar 听风吹雨 avatar

Watchers

 avatar  avatar

Forkers

songjianxing

yii-log-target's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.