bilberrry / yii2-fluentd

该包已被弃用且不再维护。没有建议的替代包。

为 Yii2 使用 Fluentd 进行日志记录

安装次数: 3,378

依赖者: 0

推荐者: 0

安全: 0

星标: 9

关注者: 2

分支: 1

类型:yii2-extension

0.1.1 2016-04-06 10:09 UTC

This package is auto-updated.

Last update: 2023-03-20 05:59:11 UTC


README

Scrutinizer Code Quality Packagist Packagist GitHub license

为 Yii2 使用 Fluentd 进行日志记录

安装

您可以使用 composer 安装此扩展。

composer require bilberrry/yii2-fluentd

或者在 composer.json 中添加

"bilberrry/yii2-fluentd": "0.1"

使用方法

将新的日志目标添加到您的配置文件中。

示例配置
...
'components' => [
    'log' => [
        'traceLevel' => YII_DEBUG ? 3 : 0,
        'targets' => [
            [
                'class' => 'bilberrry\log\FluentdTarget',
                'levels' => ['error', 'warning'], // Log levels
                'host' => 'localhost', // Fluentd host
                'port' => '24224', // Fluentd port
                'options' => [], // Options for Fluentd client
                'tagFormat' => 'app.%level' // Tag format, available placeholders: %date, %timestamp, %level
            ],
        ],
    ],
...

有关选项列表,请查看此 源代码