PHP code example of terranc / laravel-aliyun-sls

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

    

terranc / laravel-aliyun-sls example snippets



use \Islenbo\LaravelAliyunSls\Providers\LaravelAliyunSlsProvider;

return [
    // ...
    'providers' => [
        /*
         * Package Service Providers...
         */
        LaravelAliyunSlsProvider::class,
    ],
    // ...
];


return [
    // ...

    // Aliyun SLS config
    'aliyun-sls' => [
        'endpoint' => env('ALIYUN_LOG_ENDPOINT'),
        'accessKeyId' => env('ALIYUN_LOG_ACCESSKEYID'),
        'accessKey' => env('ALIYUN_LOG_ACCESSKEY'),
        'project' => env('ALIYUN_LOG_PROJECT'),
        'logstore' => env('ALIYUN_LOG_LOGSTORE'),
        'bufferLimit' => env('ALIYUN_LOG_BUFFER_LIMIT', 5),
        'formatter' => \Islenbo\LaravelAliyunSls\Formatters\AliyunSlsFormatter::class
    ],

    // ...
    'channels' => [
        'stack' => [
            'driver' => 'stack',
            // assign aliyun-sls
            'channels' => ['aliyun-sls'],
            'ignore_exceptions' => false,
            'tap' => [
            ]
        ],
        // ...
    ],
];