adapter for gelf-php to Yii CLogger
"require": {
"bankiru/yii-gelf": "~1.0"
}
Releases of Graylog2 log route for Yii client are available on Github.
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"'
],
],
// ...
],
// ...
],
// ...
],
// ...
];
docker build -t bankiru/yii-gelf:latest -f ./Dockerfile ./
docker run -it --rm --net=host -v $SSH_AUTH_SOCK:/ssh-agent-sock --env SSH_AUTH_SOCK=/ssh-agent-sock -v $(pwd):/app -w /app bankiru/yii-gelf:latest bash
composer install -o