PHPackages                             yepes/yii2-model-log-behavior - 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. yepes/yii2-model-log-behavior

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

yepes/yii2-model-log-behavior
=============================

A simple log behavior for your Yii2 models.

1.0.17(1y ago)03121MITPHP

Since Mar 8Pushed 1y ago1 watchersCompare

[ Source](https://github.com/yepes/yii2-model-log-behavior)[ Packagist](https://packagist.org/packages/yepes/yii2-model-log-behavior)[ RSS](/packages/yepes-yii2-model-log-behavior/feed)WikiDiscussions master Synced today

READMEChangelog (10)Dependencies (1)Versions (19)Used By (0)

Log Behavior
============

[](#log-behavior)

Simple extension to log every change made to any model.

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

[](#installation)

Install via composser

```
composer require yepes/yii2-model-log-behavior

```

Apply migrations:

```
./yii migrate/up --migrationPath=@vendor/yepes/yii2-model-log-behavior/migrations

```

Configure the behavior

```
public function behaviors()
{
    return [
        \goltratec\log\LogBehavior::className()
    ];
}

```

### Ignoring attributes

[](#ignoring-attributes)

In the model, just define an attribute **$logIgnoredAttributes** which is an array of string, representings the properties you wish to ignore.

```
public $logIgnoredAttributes = ['attribute1', 'attribute2'];

```

If $logIgnoredAttributes is not defined, every attribute will be logged.

### Ignore log

[](#ignore-log)

To ignore the creation of a log line, simply add ignoreLog in your model and set it to true:

Your model:

```
public $ignoreLog = false;

```

Your action you don't want to log:

```
$myModel->ignoreLog = true;
$myModel->save();

```

TODO
----

[](#todo)

Right now, logs are just saved in the database, in a table named goltratec\_log

Maybe we should:

- create a simple UI to view the logs.
- some method to view the log of a particular model.
- some way to restore a model to a particular log.

###  Health Score

36

—

LowBetter than 82% of packages

Maintenance40

Moderate activity, may be stable

Popularity13

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity69

Established project with proven stability

 Bus Factor1

Top contributor holds 100% 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 ~124 days

Recently: every ~280 days

Total

18

Last Release

509d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/2bbe1b35f04c399bf845316138e5db6f4b7fa5952d104ebc36763e2c7121024d?d=identicon)[yepes](/maintainers/yepes)

---

Top Contributors

[![yepes](https://avatars.githubusercontent.com/u/1114453?v=4)](https://github.com/yepes "yepes (27 commits)")

---

Tags

logmodelyii2extensionBehavior

### Embed Badge

![Health badge](/badges/yepes-yii2-model-log-behavior/health.svg)

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

###  Alternatives

[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)
