2017 © Pedro Peláez
 

library monolog-telegram

A handler for Monolog that sends messages to Telegram Channels

image

gh-rboliveira/monolog-telegram

A handler for Monolog that sends messages to Telegram Channels

  • Friday, February 9, 2018
  • by rboliveira
  • Repository
  • 0 Watchers
  • 0 Stars
  • 14 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 8 Forks
  • 0 Open issues
  • 10 Versions
  • 0 % Grown

The README.md

# Installation

Install using composer:, (*1)

composer require gh-rboliveira/monolog-telegram  

Usage

it is just like other monolog handlers, you need to pass below optional paramaters to telegramhandler object: - $level - The minimum logging level at which this handler will be triggered - $bubble - Whether the messages that are handled can bubble up the stack or not, (*2)

Examples

Now Simply use it like this :, (*3)

require 'vendor/autoload.php';
use Monolog\Logger;
use gh_rboliveira\TelegramHandler\TelegramHandler;

$log = new Logger('TelegramHandler');
//Create handler
$telegramHandler = new TelegramHandler();

//Add $token - your bot token provided by BotFather
$token = 'XXXXXXXXX:qeQWLElwe_m232WE1K3WEe323eeTw';
$telegramHandler->setBotToken($token);

//Set Receipts - an array with telegram ids
$recipients = ['123456789','987654321'];
$telegramHandler->setRecipients($recipients);

//Set Handler
$log->pushHandler($telegramHandler);

$log->info('hello world !');
/**
* There is 8 level of logging
*/
$log->notice('hello world !');
$log->info('hello world !');
$log->debug('hello world !');
$log->warning('hello world !');
$log->critical('hello world !');
$log->alert('hello world !');
$log->emergency('hello world !');
$log->error('hello world !');


/**
* Optionally you can pass second parameter such as a object
**/
$log->info('user just logged in !',['user'=>$user]);

License

This tool in Licensed under MIT, so feel free to fork it and make it better that it is !, (*4)

The Versions

09/02 2018

dev-master

9999999-dev https://github.com/gh-rboliveira/monolog-telegram

A handler for Monolog that sends messages to Telegram Channels

  Sources   Download

MIT

The Requires

 

by Rui Oliveira

log logging monolog telegram bots channels monolog-telegram

09/02 2018

2.0.4

2.0.4.0 https://github.com/gh-rboliveira/monolog-telegram

A handler for Monolog that sends messages to Telegram Channels

  Sources   Download

MIT

The Requires

 

by Rui Oliveira

log logging monolog telegram bots channels monolog-telegram

09/02 2018

2.0.3

2.0.3.0 https://github.com/gh-rboliveira/monolog-telegram

A handler for Monolog that sends messages to Telegram Channels

  Sources   Download

MIT

The Requires

 

by Rui Oliveira

log logging monolog telegram bots channels monolog-telegram

09/02 2018

2.0.2

2.0.2.0 https://github.com/gh-rboliveira/monolog-telegram

A handler for Monolog that sends messages to Telegram Channels

  Sources   Download

MIT

The Requires

 

by Rui Oliveira

log logging monolog telegram bots channels monolog-telegram

09/02 2018

2.0.0

2.0.0.0 https://github.com/gh-rboliveira/monolog-telegram

A handler for Monolog that sends messages to Telegram Channels

  Sources   Download

MIT

The Requires

 

by Rui Oliveira

log logging monolog telegram bots channels monolog-telegram

09/02 2018

2.0.1

2.0.1.0 https://github.com/gh-rboliveira/monolog-telegram

A handler for Monolog that sends messages to Telegram Channels

  Sources   Download

MIT

The Requires

 

by Rui Oliveira

log logging monolog telegram bots channels monolog-telegram

02/09 2017

v1.0.4

1.0.4.0 https://github.com/moeinrahimi/monolog-telegram

A handler for Monolog that sends messages to Telegram Channels

  Sources   Download

MIT

The Requires

 

log logging monolog telegram bots channels monolog-telegram

02/09 2017

dev-newfeatures

dev-newfeatures https://github.com/moeinrahimi/monolog-telegram

A handler for Monolog that sends messages to Telegram Channels

  Sources   Download

MIT

The Requires

 

log logging monolog telegram bots channels monolog-telegram

18/07 2017

v1.0.2

1.0.2.0 https://github.com/moeinrahimi/monolog-telegram

A handler for Monolog that sends messages to Telegram Channels

  Sources   Download

MIT

The Requires

 

log logging monolog telegram bots channels monolog-telegram

06/10 2016

v1.0.0

1.0.0.0 https://github.com/moeinrahimi/monolog-telegram

sends monolog logs to telegram channels using bots

  Sources   Download

MIT

The Requires