PHPackages                             devgroup/yii2-graylog-target - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Logging &amp; Monitoring](/categories/logging)
4. /
5. devgroup/yii2-graylog-target

ActiveLibrary[Logging &amp; Monitoring](/categories/logging)

devgroup/yii2-graylog-target
============================

Graylog2 log target for Yii2 framework applications

0.9.1(9y ago)58642[1 PRs](https://github.com/DevGroup-ru/yii2-graylog-target/pulls)BSDPHPPHP &gt;=5.5

Since Nov 10Pushed 7y ago2 watchersCompare

[ Source](https://github.com/DevGroup-ru/yii2-graylog-target)[ Packagist](https://packagist.org/packages/devgroup/yii2-graylog-target)[ RSS](/packages/devgroup-yii2-graylog-target/feed)WikiDiscussions master Synced 2mo ago

READMEChangelog (2)Dependencies (4)Versions (4)Used By (0)

yii2-graylog-target
===================

[](#yii2-graylog-target)

###### Graylog2 log target for Yii2 framework applications

[](#graylog2-log-target-for-yii2-framework-applications)

[![Travis build](https://camo.githubusercontent.com/6b50ed0fa4e2d6be4235b1ddb861253fb3c16b785e7f4df3e4e08c7c88541127/68747470733a2f2f7472617669732d63692e6f72672f44657647726f75702d72752f796969322d677261796c6f672d7461726765742e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/DevGroup-ru/yii2-graylog-target)

[![Latest Stable Version](https://camo.githubusercontent.com/e1973a4b3ce15b553173054b2135849f264cdc34ba8838dfed89232a268b3f7e/68747470733a2f2f706f7365722e707567782e6f72672f64657667726f75702f796969322d677261796c6f672d7461726765742f76657273696f6e)](https://packagist.org/packages/devgroup/yii2-graylog-target)[![Total Downloads](https://camo.githubusercontent.com/61d40243a680b625ce39a7dee9fca66e0e2485a8ab50cffa2db1c224392625a4/68747470733a2f2f706f7365722e707567782e6f72672f64657667726f75702f796969322d677261796c6f672d7461726765742f646f776e6c6f616473)](https://packagist.org/packages/devgroup/yii2-graylog-target)[![Latest Unstable Version](https://camo.githubusercontent.com/f6fdd0c4134c24362c842b176fc54179f7142bd50cf9ef47442ec0be07aea21b/68747470733a2f2f706f7365722e707567782e6f72672f64657667726f75702f796969322d677261796c6f672d7461726765742f762f756e737461626c65)](https://packagist.org/packages/devgroup/yii2-graylog-target)[![License](https://camo.githubusercontent.com/5a4c3979b4d53ea14485659d143297f6b975fac847541f85a6fb9136a5b23eba/68747470733a2f2f706f7365722e707567782e6f72672f64657667726f75702f796969322d677261796c6f672d7461726765742f6c6963656e7365)](https://packagist.org/packages/devgroup/yii2-graylog-target)

[![composer.lock available](https://camo.githubusercontent.com/632b57001ed2247e7f73bc644e56dd54db4dd145c3ca142942078122be2344b9/68747470733a2f2f706f7365722e707567782e6f72672f64657667726f75702f796969322d677261796c6f672d7461726765742f636f6d706f7365726c6f636b)](https://packagist.org/packages/devgroup/yii2-graylog-target)

Installation
------------

[](#installation)

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

`php composer.phar require "devgroup/yii2-graylog-target:*"`

... or just add to composer.json file the following line:

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

```

Configuration
-------------

[](#configuration)

Configure from config array

```
'components' => [
  'log' => [
    'grayii' => [
      'transport' => [
        'class' => \Gelf\Transport\HttpTransport::class,
        'host' => 'http://graylog2-server.com',
        'port' => 12201,
      ],
      'appName' => 'app name',
    ]
  ]
]
```

##### Available config parameters:

[](#available-config-parameters)

**Param key****Optional****Default value****Description**`transport`+Gelf\\Transport\\HttpTransportTransport config array for publishing a message to Graylog2 server`publisher`+Gelf\\PublisherPublisher config array`messageValidator`+Gelf\\MessageValidatorMessage validator class for publisher`container`+\\Yii::$containerDI container`version`+1.1GELF spec version`appName`+ID of the applicationCategory name for log messageUsage
-----

[](#usage)

- Sent additional data:

    ```
    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:

    ```
    try {
      ... running code with harmful bugs...
    } catch (\Throwable $t) {
      Yii::warning($t);
    }
    ```
- Sent short message:

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

Tests
-----

[](#tests)

Tests was placed int the **test** directory. Tests can be running by the command:

`php composer.phar exec codecept run`

Tests with different php versions with docker:
----------------------------------------------

[](#tests-with-different-php-versions-with-docker)

- PHP v5.6

    `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`
- PHP v7.0

    `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`
- HHVM

    `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`

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity20

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity50

Maturing project, gaining track record

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~0 days

Total

2

Last Release

3472d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/b39988f8d3bfe24528079c8e623dfcf53bb2e44052866965a8a9347b0781aea0?d=identicon)[fps01](/maintainers/fps01)

---

Tags

logyii2targetgraylog

###  Code Quality

TestsCodeception

### Embed Badge

![Health badge](/badges/devgroup-yii2-graylog-target/health.svg)

```
[![Health](https://phpackages.com/badges/devgroup-yii2-graylog-target/health.svg)](https://phpackages.com/packages/devgroup-yii2-graylog-target)
```

###  Alternatives

[hedii/laravel-gelf-logger

A Laravel package to send logs to a gelf compatible backend like graylog

1333.4M10](/packages/hedii-laravel-gelf-logger)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
