PHP code example of nyg / ali_sls_tp5

1. Go to this page and download the library: Download nyg/ali_sls_tp5 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/ */

    

nyg / ali_sls_tp5 example snippets


[
'log'                    => [
        // 日志记录方式,内置 file socket 支持扩展
        #'type'  => 'File',
        #日志驱动改为Sls 
        'type' => 'Sls',
        # 阿里云sls公网域名,阿里云的主机可以用内网
        'endpoint' => 'cn-qingdao.log.aliyuncs.com',
        # 阿里云账号和密钥
        'access_key_id' => '',
        'access_key_secret' => '',
        # 项目(Project)是日志服务中的资源管理单元
        'project' => 'php-log-test',
        # 日志库(Logstore)是日志服务中日志数据的采集、存储和查询单元
        'logstore' => '',
        
        # 可选配置
        # 默认记录详细的日志信息,如果不想记录细节可以设置为false
        'more_info'=>true,
        
        'source'=>'',
        
        // 日志记录级别
        'level' => [],
        // 日志单独记录 
        'apart_level' => [],
    ]
 ]