承接 jspapp/monolog-discord-handler 相关项目开发

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

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

jspapp/monolog-discord-handler

Composer 安装命令:

composer require jspapp/monolog-discord-handler

包简介

A Monolog handler for Discord

README 文档

README

Installation

composer require jspapp/monolog-discord-handler

Usage

<?php

require 'vendor/autoload.php';

use jspapp\MonologDiscord\DiscordHandler;

$webhook = 'Your Webhook URL';

$log = new Monolog\Logger('discord');
$log->pushHandler(new DiscordHandler($webhook, Logger::INFO));

$log->info('This is the title!', [
  'Information' => 'Context data will be shown as embedded information.',
  'Additional' => 'The footer of the card also displays the logger\'s name and error level, along with the event\'s timestamp.'
]);

Sample image

Laravel Log Driver

Import the log driver into config/logging.php:

use jspapp\MonologDiscord\Laravel\DiscordChannel;

and add the following driver configuration:

'discord' => [
  'driver' => 'custom',
  'via' => DiscordChannel::class,
  'webhook' => env('LOG_DISCORD_WEBHOOK'),
],

Rate Limit Note

I did what I could to respect Discord's rate limit, but adding the driver to Laravel's default log stack gave me issues. Use with caution in production environments, and consider selectively using:

Log::channel('discord')->info('Message');

instead of catching everything.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2018-08-06

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固