定制 kiriminaja/laravel-telegram-log 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

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

kiriminaja/laravel-telegram-log

最新稳定版本:1.0.4.2

Composer 安装命令:

composer require kiriminaja/laravel-telegram-log

包简介

Send laravel logs into Telegram Chat via bot

README 文档

README

Laravel Telegram Log

Send logs to Telegram chat via Telegram bot. Inspired by https://github.com/grkamil/laravel-telegram-logging

Documentation · Contact Us · Fun IG Account · Blog

Total Downloads Latest Stable Version License

Requirement

  • PHP 8.0 above
  • Laravel 8 or higher

Install

composer require kiriminaja/laravel-telegram-log

Configurations

Please define Telegram Bot Credentials and chat id as environment parameters by modifying .env on your project path

TELEGRAM_BOT_TOKEN=null
TELEGRAM_CHAT_ID=null
TELEGRAM_LOGGER_TEMPLATE=null
TELEGRAM_OPTIONS=[]

Create new logging channel by modifying config/logging.php file

'telegram' => [
    'driver' => 'custom',
    'via'    => TelegramLog\TelegramLogger::class,
    'level'  => 'debug',
]

Or if your default log channel is a stack, you can add it to the stack channel like this

'stack' => [
    'driver' => 'stack',
    'channels' => ['single', 'telegram'],
]

By default LOG_CHANNEL will be set into stack so you need to set default logger on env after setting up configurations above

LOG_CHANNEL=telegram

Publish config file and views to override

php artisan vendor:publish --provider "TelegramLog\TelegramServiceProvider"

Create bot

For using this plugin, you need to create telegram bot

  1. Go to @BotFather in the Telegram
  2. Send /newbot
  3. Set up name and bot-name for your bot.
  4. Get token and add it to your .env file (it is written above)
  5. Go to your bot and send /start message

Change log template at runtime

  1. Change config for template.
config(['telegram-logger.template'=>'laravel-telegram-logging::custom'])
  1. Use Log as usual

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2022-12-21