2017 © Pedro Peláez
 

library yii2-graylog-target

Graylog2 log target for Yii2 framework applications

image

devgroup/yii2-graylog-target

Graylog2 log target for Yii2 framework applications

  • Friday, November 11, 2016
  • by fps01
  • Repository
  • 2 Watchers
  • 4 Stars
  • 436 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 4 Versions
  • 17 % Grown

The README.md

yii2-graylog-target

Graylog2 log target for Yii2 framework applications

Travis build, (*1)

Latest Stable Version Total Downloads Latest Unstable Version License, (*2)

composer.lock available, (*3)

Installation

For installation the yii2-graylog-target library in your projects as composer dependency, run the command:, (*4)

php composer.phar require "devgroup/yii2-graylog-target:*", (*5)

... or just add to composer.json file the following line:, (*6)

"devgroup/yii2-graylog-target": "*"

Configuration

Configure from config array, (*7)

'components' => [
  'log' => [
    'grayii' => [
      'transport' => [
        'class' => \Gelf\Transport\HttpTransport::class,
        'host' => 'http://graylog2-server.com',
        'port' => 12201,
      ],
      'appName' => 'app name',
    ]
  ]
]
Available config parameters:
Param key Optional Default value Description
transport + Gelf\Transport\HttpTransport Transport config array for publishing a message to Graylog2 server
publisher + Gelf\Publisher Publisher config array
messageValidator + Gelf\MessageValidator Message validator class for publisher
container + \Yii::$container DI container
version + 1.1 GELF spec version
appName + ID of the application Category name for log message

Usage

  • Sent additional data:, (*8)

    Yii::info([
    'short' => 'Short message or title',  // required. alternate usage variant: `Short message or title` (without a key 'short', but first item in array)
    'full' => 'Full message',             // optional. full message of log. For example, may be a stack trace as string or other detalized message
    '_field1' => 'value1',                // optional. additional field starts with '_' symbol
    '_field2' => 'value2',                // optional. additional field starts with '_' symbol
    ]);
    
  • Sent exception:, (*9)

    try {
    ... running code with harmful bugs...
    } catch (\Throwable $t) {
    Yii::warning($t);
    }
    
  • Sent short message:, (*10)

    Yii::trace('The short message example'); // or equivalent usage is Yii::trace(['The short message example']);
    

Tests

Tests was placed int the test directory. Tests can be running by the command:, (*11)

php composer.phar exec codecept run, (*12)

Tests with different php versions with docker:

  • PHP v5.6, (*13)

    docker run -it --rm --name php56-for-grayii-tests -v "$PWD":/usr/src/myapp -w /usr/src/myapp php:5.6-cli php vendor/bin/codecept run, (*14)

  • PHP v7.0, (*15)

    docker run -it --rm --name php70-for-grayii-tests -v "$PWD":/usr/src/myapp -w /usr/src/myapp php:7.0-cli php vendor/bin/codecept run, (*16)

  • HHVM, (*17)

    docker run -it --rm --name hhvm-for-grayii-tests -v "$PWD":/usr/src/myapp -w /usr/src/myapp diegomarangoni/hhvm:cli hhvm vendor/bin/codecept run, (*18)

The Versions

11/11 2016

dev-dev

dev-dev

Graylog2 log target for Yii2 framework applications

  Sources   Download

BSD

The Requires

 

The Development Requires

by Kirill Djonua

log yii2 graylog target

10/11 2016

dev-master

9999999-dev

Graylog2 log target for Yii2 framework applications

  Sources   Download

BSD

The Requires

 

The Development Requires

by Kirill Djonua

log yii2 graylog target

10/11 2016

0.9.1

0.9.1.0

Graylog2 log target for Yii2 framework applications

  Sources   Download

BSD

The Requires

 

The Development Requires

by Kirill Djonua

log yii2 graylog target

10/11 2016

0.9.0

0.9.0.0

Graylog2 log target for Yii2 framework applications

  Sources   Download

BSD

The Requires

 

The Development Requires

by Kirill Djonua

log yii2 graylog target