terranc/laravel-aliyun-sls

There is no license information available for the latest version (1.2) of this package.

1.2 2023-08-23 05:23 UTC

This package is auto-updated.

Last update: 2024-11-23 08:11:42 UTC


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' => [
            ]
        ],
        // ...
    ],
];