anexia-it/php-cloudlog
Composer 安装命令:
composer require anexia-it/php-cloudlog
包简介
CloudLog PHP client library
README 文档
README
php-cloudlog is a client library for Anexia CloudLog.
Currently it only provides to push events to CloudLog. Querying is possible in a future release.
There are two connection types:
- directly connected for high throughput
- requires php-rdkafka (relies on librdkafka >= 0.9.1)
- http client
Get started
$ composer require anexia-it/php-cloudlog
composer.json
{
"require": {
"anexia-it/php-cloudlog": "<2.0.0"
}
}
Quickstart
<?php use CloudLog\Client; // Init CloudLog client $client = Client::create("index","ca.pem","cert.pem","cert.key"); // Alternative CloudLog client (http) $client = Client::createHttp("index","token"); // Push simple message $client->pushEvent("message"); // Push document (multiple formats supported: object, assoc array, json string) // object class Event { public $timestamp; public $user; public $message; public $severity; } $event = new Event(); $event->timestamp = 1495024205123; $event->user = "test"; $event->severity = 1; $event->message = "My first CloudLog event"; $client->pushEvent($event); // associative array $client->pushEvent([ "timestamp" => 1495024205123, "user" => "test", "severity" => 1, "message" => "My first CloudLog event" ]); // json string $client->pushEvent('{ "timestamp": 1495024205123, "user": "test", "severity": 1, "message": "My first CloudLog event" }');
统计信息
- 总下载量: 49
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2017-05-18