Coder Social home page Coder Social logo

log-notify's Introduction

log-notify

一个记录日志时同时发送消息通知的插件包,支持配置报警策略以及多种通知方式。

安装

composer require jathamj/log-notify

使用

建议集成到日志包中

$handler = new \Jathamj\LogNotify\Handler($config);

$handler->do('ERROR', '订单中心', ['orderId' => 2323, 'sd' => 'sadasd']);

配置参考

return [

    //通知接口
    'api'    => array(
        'default'   => [
            'type'              => 'dingtalk',  //通知接口类型(钉钉)
            'access_token'      => '983d92ec8a7594b927babe9fdbbad116871828f538cb18ab5ebe742547e241c6',
            'secret'            => 'SECc2e0ff9e530b5f2666a023be29f289f146f91fdfe0207e5e3d0e883e11951cf7',
        ],
    ),

    //缓存
    'redis'     => [
        'host'  => '127.0.0.1',
        'port'  => 6379,
    ],

    //报警模块
    'modules'    => array(
        'default'   => [
            'api'               => 'default',    //通知接口 (对应api配置)
            'label'             => '订单中心',    //客户化名称
            'interval'          => 3600,        //统计周期
            'times'             => 3,           //warning触发报警次数
            'frequency'         => 600,         //warning报警间隔
            'error.frequency'   => 1,           //error报警间隔
        ],
    ),
];

log-notify's People

Contributors

jathamj avatar

Watchers

 avatar

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.