PHP code example of bilberrry / yii2-fluentd

1. Go to this page and download the library: Download bilberrry/yii2-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/ */

    

bilberrry / yii2-fluentd example snippets


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