PHPackages                             apollo11/yii2-logger - 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. apollo11/yii2-logger

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

apollo11/yii2-logger
====================

Log application errors in slack channel

v1.3.0(7y ago)1011.4k↓33.3%2[4 issues](https://github.com/apolloeleven/yii2-logger/issues)1Apache-2.0PHP

Since Apr 4Pushed 4y ago7 watchersCompare

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

READMEChangelog (4)Dependencies (2)Versions (5)Used By (1)

Yii2 Custom Logger
==================

[](#yii2-custom-logger)

Sending Yii2 application logs to different targets asynchronously or synchronously.

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

[](#installation)

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

Either run

```
php composer.phar require --prefer-dist apollo11/yii2-logger "~1.0"

```

or add

```
"apollo11/yii2-logger": "~1.0"

```

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

The package offers:

1. Abstract [Target](https://github.com/apolloeleven/yii2-logger/blob/master/Target.php) class with support of sending messages asynchronously. It also has possibility to hide sensitive information when sending $\_POST or other $GLOBALS data to target.
2. Slack target: Sending messages to slack channel

Basic Usage
-----------

[](#basic-usage)

The package supports three target classes: [EmailTarget](https://github.com/apolloeleven/yii2-logger/blob/master/EmailTarget.php), [SlackTarget](https://github.com/apolloeleven/yii2-logger/blob/master/SlackTarget.php), [DbTarget](https://github.com/apolloeleven/yii2-logger/blob/master/DbTarget.php).

All target classes have support for sending messages asynchronously and hide passwords(or other sensitive data) provided by user. If you set `async` to `true` than you must provide the `consoleAppPath`.

EmailTarget and DbTarget work pretty much in the simillar way as it is described in [Yii Documentation](https://www.yiiframework.com/doc/guide/2.0/en/runtime-logging).

Add the following code to your project configuration file under `components` -&gt; `log` -&gt; `targets`

```
'class' => ,
// If async is set to true you have to provide consoleAppPath
'async' => true,
'consoleAppPath' => Yii::getAlias('@console/yii'),
// If you would like to use different php binary, when sending messages asynchronously you can set it from here
// 'phpExecPath' => 'php',
// Provide here keys which will be hidden before sending messages. It is case insensitive
'excludeKeys' => [
    '*PASSWORD*', // Will hide all keys from $GLOBALS objects which contains "password".
    '*PASSWORD', // Will hide all keys from $GLOBALS objects which ends with "password".
    'PASSWORD*', // Will hide all keys from $GLOBALS objects which starts with "password".
],
```

### SlackTarget

[](#slacktarget)

```
'class' => apollo11\logger\SlackTarget::class,
'except' => ['yii\web\HttpException:*', 'yii\web\HeadersAlreadySentException'],
'webhookUrl' => ,
'icon_url' => '',
'icon_emoji' => '', // If both, icon_url and icon_emoji is provided system will use icon_emoji
'levels' => ['error', 'warning'],
'title_link' => '',
'async' => true,
'consoleAppPath' => Yii::getAlias('@console/yii'),
'username' => '',
'excludeKeys' => [],
```

#### Important

[](#important)

If you set `async` property to true, you must add the following code into your console application `controllerMap`

```
'async' => [
    'class' => \apollo11\logger\AsyncController::class,
],

```

###  Health Score

35

—

LowBetter than 80% of packages

Maintenance12

Infrequent updates — may be unmaintained

Popularity31

Limited adoption so far

Community17

Small or concentrated contributor base

Maturity66

Established project with proven stability

 Bus Factor1

Top contributor holds 66.1% 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 ~67 days

Total

4

Last Release

2757d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/47417401?v=4)[Zura Sekhniashvili](/maintainers/arboshiki)[@arboshiki](https://github.com/arboshiki)

---

Top Contributors

[![Zura024](https://avatars.githubusercontent.com/u/17799904?v=4)](https://github.com/Zura024 "Zura024 (39 commits)")[![thecodeholic](https://avatars.githubusercontent.com/u/4627922?v=4)](https://github.com/thecodeholic "thecodeholic (18 commits)")[![paskuale75](https://avatars.githubusercontent.com/u/9800?v=4)](https://github.com/paskuale75 "paskuale75 (2 commits)")

---

Tags

slack-loggeryii2-extensionyii2-loggingyii2extension

### Embed Badge

![Health badge](/badges/apollo11-yii2-logger/health.svg)

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

###  Alternatives

[mito/yii2-sentry

Yii 2 extension for Sentry

92377.7k](/packages/mito-yii2-sentry)[sammaye/yii2-audittrail

A port of audit trail

39408.2k](/packages/sammaye-yii2-audittrail)[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)
