despatchcloudturkey/logging-api-laravel
Composer 安装命令:
composer require despatchcloudturkey/logging-api-laravel
包简介
The Logging API laravel bridge.
README 文档
README
Requirements
- Laravel 7.x or 8.x
Installation
Add as dependency on your project.
composer require despatchcloudturkey/logging-api-laravel
Set your application API credentials to your .env file.
LOGGING_API_URL=http://your-logging-api-server.com
LOGGING_API_KEY=your-api-key
If you are using VPC (Local Network) with Logging API Server, you can use private url environment.
LOGGING_API_PRIVATE_URL=http://127.0.0.1:3001
Usage
Store a log
You can create a log without ID. Logging API will assign unique ID (127 char) for your log content. This function will return this id as string.
$id = LoggingAPI::store('my log file content is here');
Store a log with ID
You can create a log with your specific ID parameter.
LoggingAPI::store('John want to go.', '123ABC');
Upload a log file
You can upload your log file to Logging API as file.
$id = LoggingAPI::upload('/path/of/my/file/'); // without ID LoggingAPI::upload('/path/of/my/file/', 'my-id'); // with ID
Get log content
You can obtain your log content as string.
$contents = LoggingAPI::get('123ABC');
Response log file
You can create a response with logged content/file.
return LoggingAPI::response('my-id);
Delete a log file
You can delete a log file in Logging API.
LoggingAPI::delete('123ABC');
Created by Despatch Cloud.
统计信息
- 总下载量: 165
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2021-06-10