dev-master 2024-01-31 06:57 UTC

This package is not auto-updated.

Last update: 2024-06-19 12:45:46 UTC


README

modelaudit/logging

installing

composer require tglogger/tg

Use

add channel to 
config/logging.php
[
    'channels' => [ 
        //... 
        'telegram' => [
            'driver' => 'custom',
            'via' => \Tglogger\Logchannel\Logging\TelegramLoggerFactory::class,
            'logger_name' => 'telegram',
            'chat_id' => env('YOUR_CHAT_ID'),
            'token' => env('YOUR_TELEGRAM_LOGGER_BOT'),
            'level' => env('YOUR_LOG_LEVEL', 'debug'),
        ],
        //or 
        'your-channel-name' => [
            'driver' => 'custom',
            'via' => \Tglogger\Logchannel\Logging\TelegramLoggerFactory::class,
            'logger_name' => 'your_logger_name',
            'chat_id' => "your chat id",
            'token' => "token",
            'level' => "log level",
        ],
        //...
    ]
]

\Log::channel('telegram')
    ->debug('log text');

//result img_2.png

or

\Log::channel('your-channel-name')
   ->debug('log text');