revangelista/telegram-logger 问题修复 & 功能扩展

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

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

revangelista/telegram-logger

最新稳定版本:1.4.0

Composer 安装命令:

composer require revangelista/telegram-logger

包简介

Send logs to Telegram chat via Telegram bot

README 文档

README

Send logs to Telegram chat via Telegram bot in your Laravel application

Install


composer require revangelista/telegram-logger

Set a new channel in the config/logging.php file, with the following variables:

'telegram' => [
    'driver'  => 'custom',
    'via'     => Logger\TelegramLogger::class,
    'level'   => 'debug',
    'token'   => '<YOUR_BOT_TOKEN>',
    'chat_id' => '<CHAT_ID>',
]

Where token is the token of your Telegram bot and chat_id is where the bot will send the messages

If you want your Telegram bot to send log messages for more than one chat at the same time, you can write the channel settings like this:

'telegram' => [
    'driver'  => 'custom',
    'via'     => Logger\TelegramLogger::class,
    'level'   => 'debug',
    'token'   => '<YOUR_BOT_TOKEN>',
    'chat_id' => [
        '<CHAT_ID_1>',
        '<CHAT_ID_2>',
        '<CHAT_ID_3>'
    ]
]

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

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

Or you can simply change the default log channel in the .env

LOG_CHANNEL=telegram

Logging

For more information on custom log channels, check the Laravel documentation on this.

Create bot

For using this package 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

统计信息

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

GitHub 信息

  • Stars: 11
  • Watchers: 1
  • Forks: 2
  • 开发语言: PHP

其他信息

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

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固