wndrfl / pushbuggy
Laravel 通过 Slack 推送日志通知
v1.2
2017-04-27 22:07 UTC
Requires
This package is not auto-updated.
Last update: 2024-09-20 20:26:22 UTC
README
这是一个方便的库,用于轻松将日志条目发送到 Slack 频道
用法
Slack
开始之前,您需要在 Slack 上创建一个机器人用户,
https://my.slack.com/services/new/bot
创建机器人后,请注意访问令牌
安装库
使用 Composer 在当前项目中安装 PushBuggy
composer require wndrfl/pushbuggy
配置 PushBuggy
将 PushBuggyServiceProvider 服务提供者添加到 config/app.php 文件中的提供者列表中
// config/app.php return [ // All the app config... 'providers' => [ // All the other providers ... // Add this provider Wndrfl\PushBuggy\PushBuggyServiceProvider::class, ]; // ... ];
接下来,在 .env 文件中添加一个配置条目 PUSHBUGGY
PUSHBUGGY=[{"token":"chat_user_token","channel":"#my-logs","name":"PushBuggy","log_level":200}]
配置变量是一个 JSON 数组,因此您可以在同一项目中拥有多个机器人用户。以下是可用的字段
要添加另一个机器人用户,只需向数组中添加更多元素,例如。
PUSHBUGGY=[{"token":"chat_user_token","channel":"#my-logs","log_level":200},{"token":"some_other_token","log_level":100}]