hongjianghuang/aliyun-log-php-sdk
Composer 安装命令:
composer require hongjianghuang/aliyun-log-php-sdk
包简介
Log Service SDK for PHP,used to set/get log data to Aliyun Log Service(www.aliyun.com/product/sls).
README 文档
README
API VERSION
0.6.1
SDK RELEASE TIME
2018-02-18
Introduction
Log Service SDK for PHP,used to set/get log data to Aliyun Log Service(www.aliyun.com/product/sls).
Use composer
composer require hongjianghuang/aliyun-log-php-sdk
Examples
$log_item = new \Aliyun_Log_Models_LogItem(); $log_item->setTime(time()); $log_item->setContents($contents); $endpoint = ''; $access_key_id = ''; $access_key = ''; $project = ''; $logstore = '' $topic = 'test'; $logitems = [ $log_item, ]; $client = new \Aliyun_Log_Client($endpoint, $access_key_id, $access_key); $request = new \Aliyun_Log_Models_PutLogsRequest($project, $logstore, $topic, $source, $logitems); $response = @$client->putLogs($request); if (200 != array_get($response->getAllHeaders(), '_info.http_code')) { throw new \Exception('Request aliyun error'); }
Summary
- Request-Request style Restful API interface
- Use Protocol buffer to send data
- Data can be compressed when sending to server
- Aliyun_Log_Exception will be thrown if any error happen
- Introduce simple logger for submit log easily with different levels
- Create local log cache to submit several logs in single http post.
Environment Requirement
- PHP 7.1.7 and later:Master Branch
- PHP 5.2+:Tree v1.0
统计信息
- 总下载量: 110
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: Unknown
- 更新时间: 2020-04-26