Skip to content

Laravel. Monolog Telegram Notification Handler

Notifications You must be signed in to change notification settings

go24dev/monolog-telegram

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 

Repository files navigation

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

About

Laravel. Monolog Telegram Notification Handler

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • PHP 100.0%