PHPackages                             mitrm/yii2-logstash - 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. mitrm/yii2-logstash

ActiveYii2-extension[Logging &amp; Monitoring](/categories/logging)

mitrm/yii2-logstash
===================

Отправка данных в Logstash

1.2(6y ago)11.7k1MITPHP

Since Aug 25Pushed 6y ago1 watchersCompare

[ Source](https://github.com/mitrm/yii2-logstash)[ Packagist](https://packagist.org/packages/mitrm/yii2-logstash)[ Docs](https://github.com/mitrm/yii2-logstash)[ RSS](/packages/mitrm-yii2-logstash/feed)WikiDiscussions master Synced 1w ago

READMEChangelogDependencies (1)Versions (4)Used By (0)

Отправка данных в Logstash.
===========================

[](#отправка-данных-в-logstash)

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

[](#installation)

The preferred way to install this extension is through [composer](http://getcomposer.org/download/).

Either run

```
php composer.phar require --prefer-dist mitrm/yii2-logstash "*"

```

or add

```
"mitrm/yii2-logstash": "*"

```

to the require section of your `composer.json` file.

Usage
-----

[](#usage)

В components добавить

Для отправки через tcp

```
        'logstash' => [
            'class' => \mitrm\logstash\LogstashSend::class,
            'config' => [
                'class' => \mitrm\logstash\transport\TcpTransport::class,
                'socket' => 'tcp://localhost:5000'
            ],
        ],
```

Для отправки через http

```
        'logstash' => [
            'class' => \mitrm\logstash\LogstashSend::class,
            'config' => [
                'class' => \mitrm\logstash\transport\HttpTransport::class,
                'port' => 5001,
                'host' => 'http://localhost'
            ],
        ],
```

Для отправки данных

```
Yii::$app->logstash->sendLog(['event' => 'orderPay', 'userId' => Yii::$app->user->id]);
```

Для отправки логов Yii в logstash

```
        'log' => [
            'traceLevel' => YII_DEBUG ? 3 : 0,
            'targets' => [
                [
                    'class' => \mitrm\logstash\LogstashTarget::class,
                    'levels' => ['error', 'warning'],
                    'logVars' => ['_GET', '_POST', '_SESSION', '_SERVER'],
                    'clientOptions' => [
                        'release' => $params['release_app'] ?? null,
                    ],
                    'isLogUser' => true, // Добавить в лог ID пользователя
                    'isLogContext' => false,
                    'extraCallback' => function ($message, $extra) {
                        $extra['app_id'] = Yii::$app->id;
                        return $extra;
                    },
                    'except' => ['order'],
                ],
            ],
        ],
```

###  Health Score

30

—

LowBetter than 64% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity21

Limited adoption so far

Community5

Small or concentrated contributor base

Maturity60

Established project with proven stability

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

3

Last Release

2458d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/0b8ac7c311b77a2512bd5a04d2c9bcf67f542c853e922f2d43ea3306b5691a4b?d=identicon)[mitrm](/maintainers/mitrm)

---

Tags

logelasticsearchtcpyii2extensiontargetELKlogstashkibana

### Embed Badge

![Health badge](/badges/mitrm-yii2-logstash/health.svg)

```
[![Health](https://phpackages.com/badges/mitrm-yii2-logstash/health.svg)](https://phpackages.com/packages/mitrm-yii2-logstash)
```

###  Alternatives

[index0h/yii2-log

Many Yii2 log targets

49204.5k](/packages/index0h-yii2-log)[lav45/yii2-activity-logger

Tools to store user activity log for Yii2

3456.3k](/packages/lav45-yii2-activity-logger)

PHPackages © 2026

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