PHP code example of uuu9 / php-api-log

1. Go to this page and download the library: Download uuu9/php-api-log library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

uuu9 / php-api-log example snippets


//注册ApiLog
$app->register(Uuu9\PhpApiLog\Provider\ApiLogServiceProvider::class);

Uuid::generate()
//修改为
Uuid::generate(4)

//通过此方式获取
Cache::store('array')->get('penetrateContext')

## 阿里云SLS配置 [/config/aliyun/sls/api_log]
SLS_API_LOG_ENDPOINT=null
SLS_API_LOG_ACCESS_KEY=null
SLS_API_SECRET_KEY=null
SLS_API_LOG_CURL_TIME_OUT_MS=null //默认1s(异步调用)
SLS_API_LOG_LOG_STORE=null //默认apilog
SLS_API_LOG_TOPIC={项目名称}-语言{php,java,fed,go}
SLS_API_LOG_PROJECT=null


//配置示例:IPDB项目
## 阿里云SLS配置 [/config/aliyun/sls/api_log]
SLS_API_LOG_ENDPOINT=null
SLS_API_LOG_ACCESS_KEY=null
SLS_API_SECRET_KEY=null
SLS_API_LOG_CURL_TIME_OUT_MS=null 
SLS_API_LOG_LOG_STORE=null
SLS_API_LOG_TOPIC=ipdb-php
SLS_API_LOG_PROJECT=null