islenbo / laravel-aliyun-sls
Installs: 3 110
Dependents: 0
Suggesters: 0
Security: 0
Stars: 2
Watchers: 1
Forks: 3
Open Issues: 0
Requires
- php: ^7.3|^8.0
- ext-json: *
- islenbo/aliyun-log-php-sdk: ^1.1
- laravel/framework: ^8.0
README
Using
composer require islenbo/laravel-aliyun-sls
add service provider to app.php
<?php use \Islenbo\LaravelAliyunSls\Providers\LaravelAliyunSlsProvider; return [ // ... 'providers' => [ /* * Package Service Providers... */ LaravelAliyunSlsProvider::class, ], // ... ];
add config to logging.php
<?php 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' => [ ] ], // ... ], ];