mttzzz/laravel-telegram-log is a Laravel package.
It currently has 3 GitHub stars and 1.444 downloads on Packagist (latest version 2.4.8).
Install it with composer require mttzzz/laravel-telegram-log.
Discover more Laravel packages by mttzzz
or browse all Laravel packages to compare alternatives.
Last updated
composer require mttzzz/laravel-telegram-log
php artisan vendor:publish --provider mttzzz\laravelTelegramLog\TelegramLogServiceProvider
Edit app/config/telegramLog.php and fill your Telegram Bot token and chatId or add env variables.
return [
// Telegram Bot Token
'token' => env('TELEGRAM_LOG_BOT_TOKEN', '111111:AAF99VnmhsE6HQtH6vsQaBRLctxXs4-UpdY'),
// Telegram Chat Id
'chat_id' => env('TELEGRAM_LOG_CHAT_ID', '-1111111111111'),
];
Edit app/config/logging.php and add channel "telegram" and change channel "stack" value 'channels' by then (example).
return [
'stack' => [
'driver' => 'stack',
'channels' => ['daily', 'telegram'],
'ignore_exceptions' => false,
],
'telegram' => [
'driver' => 'monolog',
'handler' => \mttzzz\laravelTelegramLog\HandlerTelegramLogger::class
]
];
Telegram::log('test');
Telegram::log(['test' => 'test']);
Telegram::log({"test" : "test"});