neiderruiz/sentry-notification-laravel

将 Sentry 事件发送到 Slack

dev-master / 1.0.x-dev 2022-03-23 11:19 UTC

This package is auto-updated.

Last update: 2024-09-06 23:05:52 UTC


README

要求

安装包

composer require neiderruiz/sentry-notification-laravel

步骤

  • [] - 安装包
    composer require neiderruiz/sentry-notification-laravel
  • [] - 注册提供者包,重定向到路由 config/app.php 内部提供者插入
    //sentry notification
    Neiderruiz\SentryNotificationLaravel\Providers\SentryNotificationLaravelServiceProvider::class,
  • [] - 发布提供者
php artisan vendor:publish --provider="Neiderruiz\SentryNotificationLaravel\Providers\SentryNotificationLaravelServiceProvider"
  • [] - 创建表,在终端中运行命令
php artisan queue:table  
  • [] - 运行迁移
php artisan migrate
  • [] - 配置环境变量
    #sentry
    SENTRY_LARAVEL_DSN=https://ba58cc597a7b4be1b0769052ef156fab@o1162423.ingest.sentry.io/6262441
    SENTRY_TRACES_SAMPLE_RATE=1.0
    SENTRY_SERVER_NAME=localhost
    SENTRY_TOKEN=b2bd1fb414f4445a8f39c69961f26f97efcf780db2f24463a20e893ffe09e44f
    SENTRY_URL_API=https://sentry.io/api/0/projects
    SENTRY_ORGANIZATION=flash-swunschk
    SENTRY_PROJECT=laravel-slack-dev-api

发送消息到 Slack

  • [] - 配置环境变量
    #slack
    SLACK_SEND_MESSAGE=true
    SLACK_WEBHOOK_ENDPOINT=https://hooks.slack.com/services/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

运行命令 php artisan queue:table 环境变量 SENTRY_SLACK bool

许可证

MIT