https://github.com/sergeich5/laravel-telegram-logs
Channel to send logs to Telegram chat from Laravel application
https://github.com/sergeich5/laravel-telegram-logs
laravel laravel-logging telegram
Last synced: 6 months ago
JSON representation
Channel to send logs to Telegram chat from Laravel application
- Host: GitHub
- URL: https://github.com/sergeich5/laravel-telegram-logs
- Owner: sergeich5
- Created: 2024-01-17T16:16:16.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2025-11-18T14:42:55.000Z (7 months ago)
- Last Synced: 2025-11-18T16:41:49.374Z (7 months ago)
- Topics: laravel, laravel-logging, telegram
- Language: PHP
- Homepage:
- Size: 9.77 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Installation
1. Run composer
```
composer require sergeich5/laravel-telegram-logs
```
2. Add new channel to your `config/logging.php` at `channels` stack
```php
'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',
// int|optional - telegram request timeout
'timeout' => 25,
// string|optional telegram api domain
'domain' => 'https://api.telegram.org/',
],
```
## Get Telegram updates
```bash
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 |