1. Go to this page and download the library: Download optim1zer/monolog-telegram library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
optim1zer / monolog-telegram example snippets
// ...
$handler = new \optim1zer\Monolog\TelegramHandler('<token>', <chat_id>, <log_level>);
// ...
$log = new \Monolog\Logger('telegram_channel');
$handler = new \optim1zer\Monolog\TelegramHandler(
'000000000:XXXXX-xxxxxxxxxxxxxxxxxxxxxxxxxxxxx',
123456789,
\Monolog\Logger::DEBUG
);
$handler->setFormatter(new \Monolog\Formatter\LineFormatter("%message%", null, true));
$log->pushHandler($handler);
$log->debug('Test message');
$handler = new \optim1zer\Monolog\TelegramHandler('<token>', <chat_id>, <log_level>);
$handler->setProxy('http://username:[email protected]:80'); // or simply 'http://192.168.16.1:80'
$handler->setFormatter(new \Monolog\Formatter\LineFormatter("%message%", null, true));
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.