sergeich5 / laravel-telegram-logs
Telegram log channel
Installs: 3 747
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
Requires
- php: ^7.4|^8.0
- laravel/framework: ^11.0|^12.0
README
- Run composer
composer require sergeich5/laravel-telegram-logs
- Add new channel to your
config/logging.php
atchannels
stack
'telegram' => [ 'driver' => 'custom', 'via' => \Sergeich5\LaravelTelegramLogs\TelegramLogger::class, 'level' => 'debug', // Telegram BOT_ID and TOKEN colon separated 'token' => 'BOT_ID:BOT_TOKEN', // Telegram Chat Id 'chat_id' => '12345678', // int|null to send message to specific chat thread, see: https://core.telegram.org/api/threads 'thread_id' => '123', ],
Get Telegram updates
php artisan tg_logs:updates {channel_name}
Result:
date | chat | chat_id | from | from_id | message_id | thread_id | data |
---|---|---|---|---|---|---|---|
2024-07-17 10:32:38 | CHAT_NAME1 | -12345678 | UserName | 12345 | 1 | - | Hello, world |
2024-07-17 11:26:04 | CHAT_NAME2 | -87654321 | UserName | 12345 | 2 | 5 | topic TOPIC_NAME created with id 5 |