ranvk/yii2-aliyun-logtarget

Aliyun Logtarget for Yii2

Installs: 4 908

Dependents: 0

Suggesters: 0

Security: 0

Stars: 1

Watchers: 1

Forks: 1

Open Issues: 0

Type:yii2-extension

pkg:composer/ranvk/yii2-aliyun-logtarget

v18.3.15 2018-03-15 03:38 UTC

This package is not auto-updated.

Last update: 2025-12-21 12:35:14 UTC


README

Installation

The preferred way to install this extension is through composer.

Either run

php composer.phar require --prefer-dist ranvk/yii2-aliyun-logtarget

or add

"ranvk/yii2-aliyun-logtarget": "^18.3"

Usage

To use this extension, simply add the following code in your application configuration:

return [
    //....
    'components' => [
        'log' => [
            'targets' => [
                [
                    'levels' => ['error', 'warning', 'info'],
                    'class' => 'Ranvk\Yii2AliyunLogtarget\AliyunLogTarget',
                    'logstore' => 'your_logstore',
                    'topic' => YII_ENV,
                    'project' => 'your_project',
                    'accessKeyId' => 'your_accessKeyId',
                    'accessKeySecret' => 'your_accessKeySecret',
                    'endpoint' => 'aliyun_endpoint',
                ],
            
            ],
        ],
    ],
];