PHP code example of kagatan / monolog-telegram

1. Go to this page and download the library: Download kagatan/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/ */

    

kagatan / monolog-telegram example snippets



 'channels' => [
    'stack' => [
        'driver'   => 'stack',
        'channels' => ['single', 'telegram'],
    ],
    
    ....
    
    'telegram' => [
        'driver'  => 'custom',
        'via'     => Kagatan\MonologTelegram\TelegramLogger::class,,
        'token'   => env('LOG_TELEGRAM_BOT_ID'),
        'channel' => env('LOG_TELEGRAM_CHAT_ID')
    ],
]


LOG_TELEGRAM_BOT_ID=123456789:ABCDEFGHIJKLMNOPQUSTUFWXYZabcdefghi
LOG_TELEGRAM_CHAT_ID=12345678