Logging with Fluentd for Yii2
You can install this extension with composer.
composer require bilberrry/yii2-fluentd
or add to composer.json
"bilberrry/yii2-fluentd": "0.1"
Add new log target to your configuration file.
...
'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.