Skip to content
This repository has been archived by the owner on Mar 7, 2023. It is now read-only.

bilberrry-packages/yii2-fluentd

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 

Repository files navigation

yii2-fluentd

Scrutinizer Code Quality Packagist Packagist GitHub license

Logging with Fluentd for Yii2

Installation

You can install this extension with composer.

composer require bilberrry/yii2-fluentd

or add to composer.json

"bilberrry/yii2-fluentd": "0.1"

Usage

Add new log target to your configuration file.

Example configuration
...
'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
            ],
        ],
    ],
...

For options list check this source code.