PHPackages                             agielks/yii2-log-json - 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. agielks/yii2-log-json

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

agielks/yii2-log-json
=====================

Convert your yii2 application logs as json and save it to file, redis, or logstash

1.0.0(3y ago)011.3k↓47.2%MITPHP

Since Jul 5Pushed 3y ago1 watchersCompare

[ Source](https://github.com/agielks/yii2-log-json)[ Packagist](https://packagist.org/packages/agielks/yii2-log-json)[ RSS](/packages/agielks-yii2-log-json/feed)WikiDiscussions master Synced 1mo ago

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

Yii2 Log Json Target
====================

[](#yii2-log-json-target)

Convert your yii2 application logs as json and save it to file, redis, or logstash

[![Latest Stable Version](https://camo.githubusercontent.com/e6e8a430a66c6903fac3148087635fb448ce103b8cff3ab02c2517c8d79118b5/687474703a2f2f706f7365722e707567782e6f72672f616769656c6b732f796969322d6c6f672d6a736f6e2f76)](https://packagist.org/packages/agielks/yii2-log-json)[![Total Downloads](https://camo.githubusercontent.com/dce327bf4f5b58000d8c7c88a927115f58d6fda30f1eb86da5b302495b554cea/687474703a2f2f706f7365722e707567782e6f72672f616769656c6b732f796969322d6c6f672d6a736f6e2f646f776e6c6f616473)](https://packagist.org/packages/agielks/yii2-log-json)[![Latest Unstable Version](https://camo.githubusercontent.com/18256805da3090e54bb6beef86534b4fe60279f7134717e57887ba7e72f349a1/687474703a2f2f706f7365722e707567782e6f72672f616769656c6b732f796969322d6c6f672d6a736f6e2f762f756e737461626c65)](https://packagist.org/packages/agielks/yii2-log-json)[![License](https://camo.githubusercontent.com/1347a718a90dfc21c7be760b8588d82da01f91f89c5ad90966af7c1e1cb2c827/687474703a2f2f706f7365722e707567782e6f72672f616769656c6b732f796969322d6c6f672d6a736f6e2f6c6963656e7365)](https://packagist.org/packages/agielks/yii2-log-json)[![PHP Version Require](https://camo.githubusercontent.com/6e1662b1dc54b8c149a955bb3691d290ec693a85e8128e955b923d3f857612c6/687474703a2f2f706f7365722e707567782e6f72672f616769656c6b732f796969322d6c6f672d6a736f6e2f726571756972652f706870)](https://packagist.org/packages/agielks/yii2-log-json)

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

[](#installation)

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

Either run

```
php composer.phar require --prefer-dist agielks/yii2-log-json "~1.0"

```

or add

```
"agielks/yii2-log-json": "~1.0"

```

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

Basic usage
-----------

[](#basic-usage)

### File Target

[](#file-target)

```
'components' => [
    // ...
    'log' => [
        'traceLevel' => YII_DEBUG ? 3 : 0,
        'targets' => [
            [
                'class' => 'agielks\yii2\log\json\FileTarget',
                'levels' => ['error', 'warning'],
                'except' => [
                    'yii\web\HttpException:*',
                ],
            ],
        ],
    ],
    // ...
],
```

### Logstash Target Configuration

[](#logstash-target-configuration)

```
'components' => [
    // ...
    'log' => [
        'traceLevel' => YII_DEBUG ? 3 : 0,
        'targets' => [
            [
                'class' => 'agielks\yii2\log\json\LogstashTarget',
                'dsn' => '127.0.0.1:5000',
                'index' => 'my-index',
                'type' => 'log',
                'levels' => ['error', 'warning'],
                'except' => [
                    'yii\web\HttpException:*',
                ],
            ],
        ],
    ],
    // ...
],
```

### Redis Target Configuration

[](#redis-target-configuration)

```
'components' => [
    // ...

    // Redis connection
    'redis' => [
        'class' => 'yii\redis\Connection',
        'hostname' => '127.0.0.1',
        'port' => 6379,
        'database' => 0,
    ],

    // Redis log configuration
    'log' => [
        'traceLevel' => YII_DEBUG ? 3 : 0,
        'targets' => [
            [
                'class' => 'agielks\yii2\log\json\RedisTarget',
                'db' => 'redis',
                'levels' => ['error', 'warning'],
                'except' => [
                    'yii\web\HttpException:*',
                ],
            ],
        ],
    ],
    // ...
],
```

### More Usage

[](#more-usage)

-
-

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity24

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity47

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 75% of commits — single point of failure

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

Unknown

Total

1

Last Release

1414d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/47511429?v=4)[Agiel K. Saputra](/maintainers/agielks)[@agielks](https://github.com/agielks)

---

Top Contributors

[![agielks](https://avatars.githubusercontent.com/u/47511429?v=4)](https://github.com/agielks "agielks (3 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (1 commits)")

---

Tags

logjsonredisyii2extensionlogstash

### Embed Badge

![Health badge](/badges/agielks-yii2-log-json/health.svg)

```
[![Health](https://phpackages.com/badges/agielks-yii2-log-json/health.svg)](https://phpackages.com/packages/agielks-yii2-log-json)
```

###  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)[kriss/yii2-log-reader

Yii2 log reader

1340.1k1](/packages/kriss-yii2-log-reader)

PHPackages © 2026

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