PHP code example of cblink / monolog-handler

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

    

cblink / monolog-handler example snippets


// 将
return [
    // ...
    'channels' => [
        //... 
        
        // 添加此项
        'aliyun-log' => [
            'driver' => 'monolog',
            'level' => 'debug',
            'handler' => Cblink\Monolog\Handler\AliyunLogHandler::class,
            'handler_with' => [
                'access_id' =>  '阿里云控制台access_key_id',
                'access_key' => '阿里云控制台access_key_secret',
                'endpoint' => 'cn-shenzhen',    // 节点,无需填写 log.aliyuncs.com
                'projectName' => 'laravel-project',     // 日志服务中的项目名称
                'logName' => 'service-wechat'       // 日志名称
            ]
        ],
    ]   
];