PHP code example of cyntelli / yii2-log-fluentd

1. Go to this page and download the library: Download cyntelli/yii2-log-fluentd library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

cyntelli / yii2-log-fluentd example snippets



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
                ]
            ],
        ],
    ],
    ...
];