承接 c0ns0l3/telegram-logger 相关项目开发

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

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

c0ns0l3/telegram-logger

最新稳定版本:1.2.6

Composer 安装命令:

composer require c0ns0l3/telegram-logger

包简介

Send logs to Telegram chat via Telegram bot

README 文档

README

Build Status Total Downloads Latest Stable Version License

  • Send logs to Telegram chat via Telegram bot
  • Support Telegram Topics
  • Compressing exception to HTML file and send it to Telegram for better viewing

Install


composer require c0ns0l3/telegram-logger

Define Telegram Bot Token and chat id (users telegram id) and set as environment parameters. Add to .env

TELEGRAM_LOGGER_BOT_TOKEN=bot_token
TELEGRAM_LOGGER_CHAT_ID=chat_id
TELEGRAM_LOGGER_TOPIC_ID=topic_id #if needed

Add to config/logging.php file new channel:

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

You can also configure any channels with your own options

'debug' => [
    'driver' => 'custom',
    'via'    => \TelegramLogger\TelegramLogger::class::class,
    'level'  => 'debug',
    'chat_id' => 
    'topic_id' => 
    'formatter' => new \Monolog\Formatter\LineFormatter("%message% %context% %extra%\n", null, true, true),
    'options' => [
         'parse_mode' => 'html', #html|text
         'disable_web_page_preview' => true, #true|false
         'disable_notification' => false #true|false
    ]
]

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

Publish config file and views

php artisan vendor:publish --provider "TelegramLogger\TelegramLoggerServiceProvider"

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2024-02-06