Require this package with composer.
composer require goodjun/laravel-aliyun-log
If you don't use auto-discovery, add the ServiceProvider to the providers array in config/app.php
Goodjun\AliyunLog\AliyunLogProvider::class,
php artisan vendor:publish --provider="Goodjun\AliyunLog\AliyunLogProvider"
Add your Aliyun Access Key, Key Secret, Endpoint, Project Name and Store Name to your .env
:
ALIYUN_LOG_ACCESS_KEY_ID= # access key id
ALIYUN_LOG_ACCESS_KEY_SECRET= # access key secret
ALIYUN_LOG_ENDPOINT= # endpoint, reference https://help.aliyun.com/document_detail/29008.html
ALIYUN_LOG_PROJECT= # project name
ALIYUN_LOG_LOG_STORE= # store name
Copy code in the bootstrap/app.php
:
$app->configureMonologUsing(function (Monolog\Logger $monolog) {
$handler = new Goodjun\AliyunLog\AliyunHandler();
$monolog->pushHandler($handler);
});
coming soon.