PHP code example of hongfs / thinkphp-log-sls

1. Go to this page and download the library: Download hongfs/thinkphp-log-sls 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/ */

    

hongfs / thinkphp-log-sls example snippets


return [
    'log'                    => [
        'type'  => '\\Hongfs\\Think\\Log\\Driver\\Sls', // 日志记录方式,采用 SLS
        'level' => [], // 日志记录级别 https://kancloud.cn/manual/thinkphp5/118127

        'access_key_id'     => 'LTAI5t8Cb3YjYwgSY3YKbZ',        // ACCESS_KEY_ID
        'access_key_secret' => 'T6c2ZbLURX33b4jbUOfivX704Rxu7', // ACCESS_KEY_SECRET
        'endpoint'          => 'cn-shenzhen.log.aliyuncs.com',  // 地域节点,尽可能使用内网
        'project'           => 'thinkphp-log-test',             // 日志项目名称
        'log_store'         => 'test',                          // 日志 Logstore
        'topic'             => '',                              // 日志主题
        'source'            => '',                              // 日志的来源
    ],
];