patriot/plog

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

Telegram Log WebService

dev-master 2019-02-01 13:38 UTC

This package is auto-updated.

Last update: 2025-04-29 00:45:01 UTC


README

Rest-Full webservice for sending message to telegram groups or users throw Telegram Bot Api

Installation

Using Composer

composer require patriot/plog:dev-master

then, require composer autoloader:

require __DIR__.'/../vendor/autoload.php';

you should create config.php file (copy config-sample.php) and put your credentials in it.

cd src/PLog
cp config-sample.php config.php

Config File Attributes

username: Your Inception username

password: Your Inception password

default_receiver: default Telegram group for sending logs to

How to Use

first add namespace

use PLog\PLog;

then:

$result = PLog::Send('new record saved', 'LogGroup');

or if you set default_receiver:

$result = PLog::Send('new record saved');

for loging exceptions:

 try{
 
   //do some risky staff ;)
   
 }catch(Exception $e){
 
   $result = PLog::Exception($e, 'ExceptionGroup');
   
 }