Benjamin Zikarsky https://github.com/bzikarsky/gelf-php
The preferred way to install this extension is through composer.
Either run
php composer.phar require "nex/yii2-graylog2" "*"
or add
"nex/yii2-graylog2" : "*"
to the require
section of your application's composer.json
file.
Add Graylog target to your log component config:
<?php
return [
...
'components' => [
'log' => [
'traceLevel' => YII_DEBUG ? 3 : 0,
'targets' => [
'file' => [
'class' => 'yii\log\FileTarget',
'levels' => ['error', 'warning'],
],
'graylog' => [
'class' => 'nex\graylog\GraylogTarget',
'levels' => ['error', 'warning', 'info'],
'categories' => ['application'],
'logVars' => [], // This prevent yii2-debug from crashing ;)
'host' => '127.0.0.1',
'facility' => 'facility-name',
],
],
],
],
...
];