承接 org_heigl/webhookhandler 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

org_heigl/webhookhandler

Composer 安装命令:

composer require org_heigl/webhookhandler

包简介

A monolog-handler that POSTs to a webhook

README 文档

README

Log-Hander that POSTs a log-request using HTTPlug

Installation

composer require org_Heigl/webhookhandler

Usage

  1. Create the handler
    $uriFactory = \Http\Discovery\UriFactoryDiscovery::find();
    $uri = $uriFactory->createUri('http://example.com/');
        
    $handler = new WebHookHandler(
        $uri,
        Logger::DEBUG,
        \Http\Discovery\HttpAsyncClientDiscovery::find(),
        Http\Discovery\MessageFactoryDiscovery::find()
    );
    
    $handler->setFrom('WhateverYouWant');
  1. Add the handler to the logger as you would with any other handler:
    $logger = new Logger('example');
    $logger->pushHandler($handler);
  1. Log as you are used to:
    $logger->log('Whatever you want to say');

The log-message will be send via a HTTP-POST to the provided URI (in this example to ```http://example.com/``).

The post-body will be the following json_encoded array:

[
    [message] => The message of the log-entry
    [from] => 'WhateverYouWant'
    [context] => []
    [level] => the set log-level
    [level_name] => the name of the set log-level
    [channel] => Whatever you set as channel name for the logger
    [datetime] => DateTime-Object
    [extra] => []
    [formatted] => The formatted message
 ]

That mainly is the array that monolog passes to the handlers…

统计信息

  • 总下载量: 1.84k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 2
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 2
  • Watchers: 1
  • Forks: 1
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2017-03-01

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固