Official php package for http://www.cabralog.es service.
- PHP >= 5.6
- Guzzle http client
composer require xoborg/cabralog-php-package
First you need to login into the cabralog app with your credentials, and get your TokenUser and the TokenProject from the project you want to use.
And that's it, now you can start sending logs to cabralog.
use Xoborg\Cabralog\Cabralog;
...
Cabralog::setTokenUser('{TokenUser}');
Cabralog::setTokenProject('{TokenProject}');
$response = Cabralog::setLog('{Name}', '{LogContent}');
$response = Cabralog::setText('{Name}', '{LogContent}');
$response = Cabralog::setTimeStats('{Name}', '{LogContent}');
If you want to send logs to multiple projects, you can specify the TokenProject on each method call:
use Xoborg\Cabralog\Cabralog;
...
Cabralog::setTokenUser('{TokenUser}');
$response = Cabralog::setLog('{Name}', '{LogContent}', '{TokenProject}');
$response = Cabralog::setText('{Name}', '{LogContent}', '{TokenProject2}');
$response = Cabralog::setTimeStats('{Name}', '{LogContent}', '{TokenProject3}');