megadevelop / php-megalogger-client
Client lib off megalogger
dev-master
2016-08-04 01:38 UTC
Requires
- php: >=5.4
- emarref/jwt: 1.0.1
This package is not auto-updated.
Last update: 2025-01-04 20:24:03 UTC
README
##Installation:
composer require megadevelop/php-megalogger-client
###OR add in file composer.json
"require": { "megadevelop/php-megalogger-client":"dev-master" }
##Usage: Create an instance of the LoggerClients\LoggerClient class
use LoggerClients\LoggerClient;
$apiKey = "asfkjewf46388asfafsf_megaToken";
$loggerClient = new LoggerClient($apiKey);
// Get level: info, debug, warning, error, critical
$levelObj = new Level();
$level = $levelObj->getLevelInfo();
$source = 'source_log';
$data = array("message" => "Message attachment token");
//push log
$response = $loggerClient->pushLog($level, $data, $source);
echo '<pre>';
print_r($response);
echo '</pre>';