PHPackages                             sergeymakinen/yii2-log-message - 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. sergeymakinen/yii2-log-message

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

sergeymakinen/yii2-log-message
==============================

Log message object for Yii 2 log targets

v2.1.0(8y ago)2223.5k—1%24MITPHP

Since Jan 4Pushed 5y ago2 watchersCompare

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

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

Yii 2 log message object
========================

[](#yii-2-log-message-object)

Log message object that wraps a log message and exposes its properties as well as the current request/user details to Yii 2 log targets.

[![Code Quality](https://camo.githubusercontent.com/8ae1e39d36391039b0642c99794d8a1e34c8edc62d9ad3bdc59f7316a36d1fed/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f672f7365726765796d616b696e656e2f796969322d6c6f672d6d6573736167652e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/sergeymakinen/yii2-log-message) [![Build Status](https://camo.githubusercontent.com/81aabd6c7ee5c6f77bec6cbcb86fcfd3b922631d71b8bd890719ce571c23be61/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f7365726765796d616b696e656e2f796969322d6c6f672d6d6573736167652e7376673f7374796c653d666c61742d737175617265)](https://travis-ci.org/sergeymakinen/yii2-log-message) [![Code Coverage](https://camo.githubusercontent.com/db07185a647a69ba2eb91253b51950ae3a93546cf0f1809892929119cb0fadb1/68747470733a2f2f696d672e736869656c64732e696f2f636f6465636f762f632f6769746875622f7365726765796d616b696e656e2f796969322d6c6f672d6d6573736167652e7376673f7374796c653d666c61742d737175617265)](https://codecov.io/gh/sergeymakinen/yii2-log-message) [![SensioLabsInsight](https://camo.githubusercontent.com/5b42a784b21f4f0009dbee24a07a7fd53e7f9b98caa2c4faf4c41cfab5875a01/68747470733a2f2f696d672e736869656c64732e696f2f73656e73696f6c6162732f692f39393030643563312d326135342d346465342d393138342d3738313565316232323635302e7376673f7374796c653d666c61742d737175617265)](https://insight.sensiolabs.com/projects/9900d5c1-2a54-4de4-9184-7815e1b22650)

[![Packagist Version](https://camo.githubusercontent.com/10b7f390effc539d5f2238b4d6bec13b76ca08e536e9a3d7c6cc5c0e2f1bc61b/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f7365726765796d616b696e656e2f796969322d6c6f672d6d6573736167652e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/sergeymakinen/yii2-log-message) [![Total Downloads](https://camo.githubusercontent.com/b3130131e86c484b47e4e67702636fe3bd6a415e367a4ae753fc4335b93a4b51/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f7365726765796d616b696e656e2f796969322d6c6f672d6d6573736167652e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/sergeymakinen/yii2-log-message) [![Software License](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE)

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

[](#installation)

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

Either run

```
composer require "sergeymakinen/yii2-log-message:^2.0"
```

or add

```
"sergeymakinen/yii2-log-message": "^2.0"
```

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

Usage
-----

[](#usage)

Let's take a look at the [Slack log target](https://github.com/sergeymakinen/yii2-slack-log) code excerpt:

```
// ...
// $message is the sergeymakinen\yii\logmessage\Message class instance
$attachment = [
    'fallback' => $this->encode($this->formatMessage($message->message)),
    'title' => ucwords($message->level),
    'fields' => [],
    'text' => "```\n" . $this->encode($message->text . "\n```",
    'footer' => static::className(),
    'ts' => (int) round($message->timestamp),
    'mrkdwn_in' => [
        'fields',
        'text',
    ],
];
if ($message->isConsoleRequest) {
    $attachment['author_name'] = $message->commandLine;
} else {
    $attachment['author_name'] = $attachment['author_link'] = $message->url;
}
if (isset($this->colors[$message->message[1]])) {
    $attachment['color'] = $this->colors[$message->message[1]];
}
$this
    ->insertField($attachment, 'Level', $message->level, true, false)
    ->insertField($attachment, 'Category', $message->category, true)
    ->insertField($attachment, 'Prefix', $message->prefix, true)
    ->insertField($attachment, 'User IP', $message->userIp, true, false)
    ->insertField($attachment, 'User ID', $message->userId, true, false)
    ->insertField($attachment, 'Session ID', $message->sessionId, true)
    ->insertField($attachment, 'Stack Trace', $message->stackTrace, false);
// ...
```

###  Health Score

39

—

LowBetter than 86% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity38

Limited adoption so far

Community18

Small or concentrated contributor base

Maturity66

Established project with proven stability

 Bus Factor1

Top contributor holds 88.2% 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 ~134 days

Total

4

Last Release

3017d ago

Major Versions

v1.0.0 → v2.0.02017-01-25

### Community

Maintainers

![](https://www.gravatar.com/avatar/362b43cdb5f7eb9e46a3e650b533e83cf2e6492ff705693f60b646b66c0cf8a7?d=identicon)[sergeymakinen](/maintainers/sergeymakinen)

---

Top Contributors

[![sergeymakinen](https://avatars.githubusercontent.com/u/983964?v=4)](https://github.com/sergeymakinen "sergeymakinen (15 commits)")[![adipriyantobpn](https://avatars.githubusercontent.com/u/4537439?v=4)](https://github.com/adipriyantobpn "adipriyantobpn (1 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (1 commits)")

---

Tags

loglog-messageloggingmessagephpphp-libraryyii2yii2-extensionlogmessageloggingyii2yiiyii2-log-message

### Embed Badge

![Health badge](/badges/sergeymakinen-yii2-log-message/health.svg)

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

###  Alternatives

[mero/yii2-monolog

The Monolog integration for the Yii framework.

42186.1k](/packages/mero-yii2-monolog)[baibaratsky/yii2-rollbar

Rollbar for Yii2

35130.5k](/packages/baibaratsky-yii2-rollbar)

PHPackages © 2026

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