承接 mahmoud-mhamed/laravel-slack-errors-log 相关项目开发

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

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

mahmoud-mhamed/laravel-slack-errors-log

最新稳定版本:0.0.6

Composer 安装命令:

composer require mahmoud-mhamed/laravel-slack-errors-log

包简介

This is my package laravel-slack-errors-log

README 文档

README

This package can quickly send alerts to Slack. You can use this to notify yourself of any error.

Installation

You can install the package via composer:

composer require mahmoud-mhamed/laravel-slack-errors-log

You can publish the config file with:

php artisan vendor:publish --tag="laravel-slack-errors-log-config"

This is the contents of the published config file:

return [
    'log_error_in_local' => env('SLACK_LOG_ERROR_IN_LOCAL', false),
    'log_header' => env('SLACK_LOG_HEADER', true),
    'header_title' => null, // null = 🚨 env('APP_NAME') Exception Occurred!
    'log_content' => env('SLACK_LOG_CONTENT', true),
    'content' => null, //null = send error message
    'log_url' => env('SLACK_LOG_URL', true),
    'log_auth' => env('SLACK_LOG_AUTH', true),
    'log_trace' => env('SLACK_LOG_TRACE', false),
    'append_message' => null,//string data append to slack log message
];

Create New Webhook URL

to create webhook read doc in https://api.slack.com/messaging/webhooks

Usage

in .env file add LOG_SLACK_WEBHOOK_URL="https://hooks.slack.com/services/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"

in App\Exceptions\Handler.php in register function add

use Mahmoudmhamed\LaravelSlackErrorsLog\LaravelSlackErrorsLog;

$this->reportable(function (Throwable $e) {
     LaravelSlackErrorsLog::sendSlackError($e);
});

Credits

License

The MIT License (MIT). Please see License File for more information.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2023-06-07