bankiru/yii-gelf

Graylog2 log route for Yii

1.1.0 2015-12-18 13:38 UTC

README

adapter for gelf-php to Yii CLogger

Build Status Scrutinizer Code Coverage Status Coveralls Code Coverage Status Scrutinizer Quality Score SensioLabsInsight Dependency Status HHVM Status License

Installing

Composer

"require": {
  "bankiru/yii-gelf": "~1.0"
}

Github

Releases of Graylog2 log route for Yii client are available on Github.

Documentation

To enable logging to Graylog2 you should add log route to Yii config. For example:

return [
    // ...
    'components' => [
        // ...
        'log' => [
            // ...
            'routes' => [
                // ...
                'graylog2' => [
                    'class'     => 'Bankiru\\Yii\\Logging\\Graylog2\\GelfLogRoute',
                    'levels'    => 'info,warning,error',
                    'host'      => '127.0.0.1',
                    'port'      => 12201,
                    // 'chunkSize' => Gelf\Transport\UdpTransport::CHUNK_SIZE_LAN,
                    'extra'     => [
                        'some_extra_field' => 'which will be added to "additionals"'
                    ],
                ],
                // ...
            ],
            // ...        
        ],
        // ...
    ],
    // ...
];