megaads-vn/megalogger

Megalogger client library

dev-master 2017-01-24 04:18 UTC

This package is not auto-updated.

Last update: 2024-12-16 14:31:54 UTC


README

##Installation:

composer require megaads-vn/megalogger

###OR add in file composer.json

"require": {
	"megaads-vn/megalogger":"dev-master"
}

##Usage: Create an instance of the MegaLogger\Logger class

use MegaLogger\Logger;

$apiKey = "asefas_efjhj-afsd64sf";
$source = "Your source";
$initData = array(
    'apiKey' => $apiKey,
    'source' => $source
);
$loggerClient = new Logger($initData);

// Get level: info, debug, warning, error, critical
$levelObj = new Level();
$level = $levelObj->getLevelInfo();

$data = array("message" => "Message attachment token", "title" => "Title for push log");
//push log 

$response = $loggerClient->pushLog($level, $data);
echo '<pre>';
print_r($response);
echo '</pre>';