cyntelli/yii2-log-fluentd

Logging with Fluentd for Yii2

0.1.1 2021-02-26 07:18 UTC

This package is auto-updated.

Last update: 2024-10-26 15:42:31 UTC


README

Latest Stable Version Total Downloads

Logging with Fluentd for Yii2.

Installation

The preferred way to install this extension is through composer.

Either run

php composer.phar require "cyntelli/yii2-log-fluentd" "*"

or add

"cyntelli/yii2-log-fluentd" : "*"

to the require section of your application's composer.json file.

Usage

Add Fluentd target to your log component config:

<?php
return [
    ...
    'components' => [
        'log' => [
            'traceLevel' => YII_DEBUG ? 3 : 0,
            // 'flushInterval' => 1,
            'targets' => [
                'fluentdTarget' => [
                    'class' => 'cyntelli\log\FluentdTarget',
                    'levels' => ['error', 'warning'], // Log levels
                    // 'exportInterval' => 1,
                    'host' => 'host', // Fluentd host
                    'port' => '24224', // Fluentd port
                    'options' => [], // Options for Fluentd client
                    'tag' => 'app' // Tag
                ]
            ],
        ],
    ],
    ...
];