dyanakiev/laravel-logger-discord-channel 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

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

dyanakiev/laravel-logger-discord-channel

最新稳定版本:6.1.3

Composer 安装命令:

composer require dyanakiev/laravel-logger-discord-channel

包简介

A Discord based Monolog driver for Laravel

README 文档

README

A Discord based Monolog driver for Laravel

Latest Stable Version Total Downloads Daily Downloads Latest Unstable Version License PHP Version Require

Install

composer require dyanakiev/laravel-logger-discord-channel

Usage

  1. Add the new discord channel type in your config/logging.php configuration file, find the channels section and add the discord array within
'channels' => [
        'discord' => [
            'driver' => 'custom',
            'via' => dyanakiev\LoggerDiscordChannel\DiscordLogger::class,
            'suffix' => env('DISCORD_LOG_SUFFIX','Laravel Log'), // Message title suffix
            'webhook' => env('DISCORD_LOG_WEBHOOK', false), // e.g. https://discordapp.com/api/webhooks/...
            'level' => env('DISCORD_LOG_LEVEL', 'debug'), // You can choose from: emergency, alert, critical, error, warning, notice, info and debug
            'context' => env('DISCORD_LOG_CONTEXT', false), // Enable this if you want to receive the full context of an error, usually useless
            'environment' => env('DISCORD_LOG_ENVIRONMENT', 'production'), // Enable logging only for environment ['production', 'staging', 'local']
            'message' => env('DISCORD_LOG_MESSAGE', false), // Here you can put extra message or tag role or person via @personName
        ],
],
  1. Add the new discord channel inside the stack channel, its recommended to set LOG_CHANNEL to stack so you can still have your daily logs when running in production
  2. Customize the package settings either directly in the config or in the .env file

Note

You may need to clear cache after installation if you get laravel.EMERGENCY: Unable to create configured logger. ... Log [discord] is not defined. with

php artisan config:clear

Dont forget to cache the config again after clearing cache if ran on production :)

php artisan config:cache

Example logs

demo-error-imessage demo-info-imessage

统计信息

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

GitHub 信息

  • Stars: 6
  • Watchers: 0
  • Forks: 11
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2020-11-11