jackmartin/telegram-logger-errors

Telegram logger errors package laravel
31,255 13
Install
composer require jackmartin/telegram-logger-errors
Latest Version:1.8
PHP:^7.0 || ^7.2 || ^7.3
License:MIT
Last Updated:Oct 4, 2022
Links: GitHub  ·  Packagist
Maintainer: jackmartin

header

Telegram logger errors

Пакет для laravel TLE - Telegram логгер ошибок

Latest Stable Version Total Downloads License

bot

Read this in other language: English, Русский, Український

Требования

  • php 7.0
  • composer

Установка

Установить пакет с помощью composer

composer require jackmartin/telegram-logger-errors

Laravel Настройка

После установки пакета с помощью composer, зарегистрируйте сервис пакета в файле config/app.php:

Telegram\Bot\Laravel\TelegramServiceProvider::class,
TLE\TLEServiceProvider::class

Затем для быстрого вызов класса пакета, добавьте псевдоним в этот же файле:

'Telegram' => Telegram\Bot\Laravel\Facades\Telegram::class,
'TLE' => TLE\Facades\TLEFacade::class

Копируем файл настроек telegram.php, tle.php в config папку

Telegram SDK
php artisan vendor:publish

Выбираем Provider: Telegram\Bot\Laravel\TelegramServiceProvider

TLE
php artisan vendor:publish

Выбираем Tag: tle-config

или

php artisan vendor:publish --provider="TLE\TLEServiceProvider" --tag="tle-config"
Настройка токена и имя бота в config/telegram.php
'bots'  => [
    'common' => [
        'username' => 'Name bot',
        'token'    => 'Token bot',
        'commands' => [],
    ],

],
'default'  => 'common',
Режим отладки
'debug' => false
Имя бота

Нужно для Telegram SDK

'botname' => ''
Идентификатор чата
'chat_id' => ''
Сохраняние лога
'save_log' => true
Путь сохранения временного файла
'path_save' => 'local'
Отключение записи ошибок Telegram в лог файл
'disable_exception_telegram' => false

Использование

Отправка простого исключения
use TLE;

try {

    print_r($a);

} catch (\Exception $e) {

    TLE::exp($e)->send();

}
Отправка простого исключения + информацию
use TLE;

try {

    print_r($a);

} catch (\Exception $e) {

    TLE::exp($e)->info('Field check')->send();

}
Отправка Guzzle исключения
use TLE;

try {

    print_r($a);

} catch (RequestException $e) {

    TLE::guzzle($e)->send();

}

Добавление класса TLE в глобальный обработчик ошибок в app\Exceptions\Handler.php

public function report(Exception $exception)
{

    \TLE::exp($exception)->send();

    parent::report($exception);

}

Related Packages

marekmiklusek/telegram-logger

Send Laravel logs and exceptions to Telegram, with flood protection and redactio...

1,342 1
denoby/laravel-telegram-logger

Laravel package for sending logs and messages to Telegram

1,366 1
emotality/laravel-telegram-logger

Laravel package to report exceptions to a Telegram chat, group or channel.

12,535 2
nwservices/laravel-telegram-logger

A Laravel package that monitors laravel.log and sends Telegram notifications whe...

1,193 0

Version History

Version Released PHP Laravel License
1.8 ^7.0 || ^7.2 || ^7.3 ^5.5 || ^6.0 || ^7.0 || ^8.0 || ^9.0 MIT
1.7 ^7.0 || ^7.2 || ^7.3 ^5.5 || ^6.0 || ^7.0 || ^8.0 MIT
1.6 ^7.0 || ^7.2 || ^7.3 ^5.5 || ^6.0 || ^7.0 || ^8.0 MIT
1.5 ^7.0 || ^7.2 || ^7.3 ^5.5 || ^6.0 || ^7.0 || ^8.0 MIT
1.4 ^7.0 || ^7.2 ^5.5 || ^6.0 MIT