LaravelPackages.net
Acme Inc.
Toggle sidebar
kagatan/monolog-telegram

A handler for Monolog that sends messages to Telegram Channels. Laravel

13.916
2
v1.4
About kagatan/monolog-telegram

kagatan/monolog-telegram is a Laravel package for a handler for monolog that sends messages to telegram channels. laravel. It currently has 2 GitHub stars and 13.916 downloads on Packagist (latest version v1.4). Install it with composer require kagatan/monolog-telegram. Discover more Laravel packages by kagatan or browse all Laravel packages to compare alternatives.

Last updated

monolog-telegram

🔔 Telegram Handler which allows you log messages to telegram channels using bots for Laravel

Installation


Install using composer:

composer require kagatan/monolog-telegram  

Usage

Open up config/logging.php and find the channels key. Add the following channel to the list.


 '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')
    ],
]

Add the following information to your .env file. Your LOG_TELEGRAM_BOT_ID is for the your bot key and LOG_TELEGRAM_CHAT_ID is the chat ID for a telegram user or channel.

LOG_TELEGRAM_BOT_ID=123456789:ABCDEFGHIJKLMNOPQUSTUFWXYZabcdefghi
LOG_TELEGRAM_CHAT_ID=12345678

Star History Chart