定制 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
  • 点击次数: 8
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

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

其他信息

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

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固