承接 holdmann/monolog-telegram-async 相关项目开发

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

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

holdmann/monolog-telegram-async

最新稳定版本:v1.0.0

Composer 安装命令:

composer require holdmann/monolog-telegram-async

包简介

Handler for Monolog to send logs by Telegram asynchronously

README 文档

README

Handler for Monolog to send logs by Telegram asynchronously in HTML format

Requirements

  • PHP 7.4 or above
  • Guzzle 7+

Installation with composer

composer require holdmann/monolog-telegram-async  

Declaring handler object

To declare this handler, you need to know the bot token and the chat identifier(chat_id) to which the log will be sent.

// ...
$handler = new \Holdmann\Monolog\TelegramAsyncHandler('<token>', <chat_id>, <log_level>);
// ...

Example:

$log = new \Monolog\Logger('telegram_channel');

$handler = new \Holdmann\Monolog\TelegramAsyncHandler(
    '000000000:XXXXX-xxxxxxxxxxxxxxxxxxxxxxxxxxxxx',
    123456789,
    \Monolog\Logger::DEBUG
);
$handler->setFormatter(new \Monolog\Formatter\LineFormatter("%message%", null, true));
$log->pushHandler($handler);

$log->debug('Test message');

The above example is using standard LineFormatter from Monolog package. You can write and use your own message formatter for better logs format.

Example with proxy (for russian servers):

$handler = new \Holdmann\Monolog\TelegramAsyncHandler('<token>', <chat_id>, <log_level>);
$handler->setProxy('http://username:password@192.168.16.1:80'); // or simply 'http://192.168.16.1:80'
$handler->setFormatter(new \Monolog\Formatter\LineFormatter("%message%", null, true));

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2026-04-28