davarch/telegram-logger

Telegram Logger for Laravel

v1.2.0 2022-11-12 20:52 UTC

This package is auto-updated.

Last update: 2025-06-13 02:38:05 UTC


README

Install

composer require davarch/telegram-logger

php artisan telegram-logger:publish

Add to config/logging.php:

'channels' => [
    ...
    'telegram' => [
        'driver' => 'custom',
        'via' => \Davarch\TelegramLogger\Logging\TelegramLoggerFactory::class,
        'level' => env('LOG_LEVEL', 'debug'),
    ],
],

Edit to .env file:

TELEGRAM_LOGGER_BOT_TOKEN=YOUR_BOT_TOKEN
TELEGRAM_LOGGER_CHAT_ID=YOUR_CHAT_ID

Usage

logger()?->channel('telegram')->debug('debug message');