noroman / php-tglogger
Logging in telegram chats, channels.
v1.0.0
2022-05-19 06:14 UTC
Requires
- php: >=7.4.0
- ext-curl: *
- ext-json: *
- ext-mbstring: *
This package is auto-updated.
Last update: 2026-03-19 14:37:26 UTC
README
Logging in telegram chats, channels.
Example
<?php
use TgLogger\TgLogger;
require_once __DIR__ . '/../vendor/autoload.php';
$chatId = -100…92;
$botToken = '528…74:AA…0s';
$log = new TgLogger($botToken, $chatId, 'project name [optional]');
try {
$log->Error('test error', ['id' => 4, 'firstName' => 'Roman', 'lastName' => 'Novikov']);
} catch (Exception $e) {
// to the standard log
error_log($e->getMessage() .':: '. $log->getMessage());
}