nechaienko/laravel-telegram-logging

There is no license information available for the latest version (1.0.11) of this package.

Logging to Telegram using Laravel logging

1.0.11 2019-05-30 08:08 UTC

This package is auto-updated.

Last update: 2024-04-29 04:12:54 UTC


README

This package gives opportunity logging to telegram with custom Laravel logging

Installation

composer require nechaienko/laravel-telegram-logging

Configuration

Add configurations to file ..\your_project\config\logging.php

'telegram' => [
            'driver' => 'custom',
            'via' => \Nechaienko\TelegramLogging\LogToTelegram::class,
            'level' => 'info'
        ],

Add Telegram Bot Token to file ..\your_project\.env

TELEGRAM_BOT_TOKEN=****

Create file telegram.php in config folder ..\your_project\config\telegram.php'

<?php

return [
    'telegram_admin_ids' => [
        '*********', //developer 1
        '*********', //developer 2
    ]
];

Usage

use Illuminate\Support\Facades\Log;
...
Log::channel('telegram')->info('message');