PHPackages                             cebe/yii2-loki-log-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. cebe/yii2-loki-log-target

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

cebe/yii2-loki-log-target
=========================

Grafana Loki Log Target for Yii2

1.2.0(1y ago)614.1k—4.3%2MITPHPPHP &gt;=7.1.0

Since May 12Pushed 1y ago2 watchersCompare

[ Source](https://github.com/cebe/yii2-loki-log-target)[ Packagist](https://packagist.org/packages/cebe/yii2-loki-log-target)[ RSS](/packages/cebe-yii2-loki-log-target/feed)WikiDiscussions main Synced 1mo ago

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

yii2-loki-log-target
====================

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

Grafana Loki Log Target for Yii2.

Requirements
------------

[](#requirements)

- PHP 7.1 or higher (works with PHP 8)
- Yii 2

Install
-------

[](#install)

```
composer require cebe/yii2-loki-log-target

```

Usage
-----

[](#usage)

Add the log target to your application config:

```
// ...
'components' => [
    // ...
    'log' => [
        // ...
        'targets' => [
            [
                'class' => \cebe\lokilogtarget\LokiLogTarget::class,
                //'enabled' => YII_ENV_PROD,

                'lokiPushUrl' => 'https://loki.example.com/loki/api/v1/push',
                'lokiAuthUser' => 'loki', // HTTP Basic Auth User
                'lokiAuthPassword' => '...', // HTTP Basic Auth Password

                'levels' => ['error', 'warning', 'info'],

                // optionally exclude categories
                'except' => [
                    'yii\db\Connection::open',
                    'yii\db\Command::execute',
                    'yii\httpclient\StreamTransport::send',
                ],

                // optionally re-map log level for certain categories
                'levelMap' => [
                    // yii category
                    'yii\web\HttpException:404' => [
                        // yii level => loki level
                        // set loki level to false, to drop messages with that category
                        '*' => 'info',
                    ],
                    'yii\web\HttpException:401' => [
                        // yii level => loki level
                        // set loki level to false, to drop messages with that category
                        '*' => 'warning',
                    ],
                ],

            ],
        ],
    ],
]
```

See also .

###  Health Score

32

—

LowBetter than 72% of packages

Maintenance31

Infrequent updates — may be unmaintained

Popularity33

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 62.5% 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

Every ~195 days

Total

3

Last Release

711d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/261a6249c6f605f3956a2fae40fbb813f6b2e1e6f2bf806180c851a965426e54?d=identicon)[cebe](/maintainers/cebe)

---

Top Contributors

[![cebe](https://avatars.githubusercontent.com/u/189796?v=4)](https://github.com/cebe "cebe (10 commits)")[![arkhamvm](https://avatars.githubusercontent.com/u/9816112?v=4)](https://github.com/arkhamvm "arkhamvm (4 commits)")[![lukassarfert](https://avatars.githubusercontent.com/u/60043850?v=4)](https://github.com/lukassarfert "lukassarfert (2 commits)")

---

Tags

loggingyii2grafanaloki

### Embed Badge

![Health badge](/badges/cebe-yii2-loki-log-target/health.svg)

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

###  Alternatives

[bedezign/yii2-audit

Yii2 Audit records and displays web/cli requests, database changes, php/js errors and associated data.

201657.4k4](/packages/bedezign-yii2-audit)[mero/yii2-monolog

The Monolog integration for the Yii framework.

42186.1k](/packages/mero-yii2-monolog)

PHPackages © 2026

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