HTTP API Handler for php monolog which allows you to log messages into external API of your choice.
Install using composer:
composer require sakydev/monolog-httpapi
TODO
Now Simply use it like this :
require 'vendor/autoload.php';
use Monolog\Logger;
use sakydev\HttpApiHandler\HttpApiHandler;
$log = new Logger('HttpApiHandler');
$channel = 'default-channel';
$headers = ['Content-Type: application/json'];
$log->pushHandler(new HttpApiHandler('http://url-here.com', $channel, $headers));
$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 paramater such as a object
**/
$log->info('user just logged in !',['user'=>$user]);
This tool in Licensed under MIT, so feel free to fork it and make it better than it is !