Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/megaads-vn/php-megalogger-client

Megalogger client PHP library
https://github.com/megaads-vn/php-megalogger-client

Last synced: 10 days ago
JSON representation

Megalogger client PHP library

Awesome Lists containing this project

README

        

# php megalogger client

##Installation:
```javascript
composer require megaads-vn/megalogger
```
###OR
**add in file composer.json**
```javascript
"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 '

';

print_r($response);
echo '
';
```