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

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

patipark/yii2-log
=================

ใช้ในการเก็บ Log ของ Active Record Model โดยเก็บทุกฟิวด์ของตาราง ก่อน/หลัง การแก้ไข ไว้ในตารางในรูปแบบ JSON

v1.0.1(4y ago)0117MITPHPPHP ^7.2.0

Since Jul 17Pushed 4y ago1 watchersCompare

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

READMEChangelogDependencies (1)Versions (2)Used By (0)

yii2-log
========

[](#yii2-log)

ใช้ในการเก็บ Log ของ Active Record Model โดยเก็บทุกฟิวด์ของตาราง ก่อน/หลัง การแก้ไข ไว้ในตารางในรูปแบบ JSON

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

[](#installation)

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

Either run

```
php composer require patipark/yii2-log "dev-master"

```

or add

```
    "require": {
        ......
        "patipark/yii2-log": "dev-master"
        ......
    }

```

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

Apply migrations เสร็จแล้วจะสร้างตารางชื่อว่า yii2\_log เพื่อเก็บ Log

```
yii migrate/up --migrationPath=@vendor/patipark/yii2-log/migrations

```

Configure the behavior

```
class YourModel extends \yii\db\ActiveRecord
{
    public $ignoreLogAttributes = ['created_by', 'created_at', 'updated_by', 'updated_at'];

    public function behaviors()
    {
        return [
            \patipark\yii2log\LogBehavior::class,
            ......
            ......
        ];
    }
```

### attributes ที่ไม่ต้องการเก็บ log

[](#attributes-ที่ไม่ต้องการเก็บ-log)

ให้ประกาศตัวแปร ไว้ใน model ขื่อว่า **$ignoreLogAttributes** แต่ถ้าไม่ได้ประกาศไว้ จะเก็บ log ทุกฟิวด์

```
public $ignoreLogAttributes = ['created_by', 'created_at', 'updated_by', 'updated_at'];
```

การทำงาน
--------

[](#การทำงาน)

ข้อมูลจะเก็บในตารางชื่อ yii2\_log และเก็บข้อมูลในรูปแบบ JSON โดยข้อมูลทุกฟิวด์ก่อนการเปลี่ยนแปลงจะเก็บไว้ในฟิวด์ before\_change ข้อมูลทุกฟิวด์หลังการเปลี่ยนแปลงจะเก็บไว้ในฟิวด์ after\_change

###  Health Score

23

—

LowBetter than 27% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity10

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity46

Maturing project, gaining track record

 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

Unknown

Total

1

Last Release

1760d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/10300449?v=4)[Patipark Sopha](/maintainers/Patipark)[@patipark](https://github.com/patipark)

---

Top Contributors

[![patipark](https://avatars.githubusercontent.com/u/10300449?v=4)](https://github.com/patipark "patipark (9 commits)")

### Embed Badge

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

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

###  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)[mito/yii2-sentry

Yii 2 extension for Sentry

92377.7k](/packages/mito-yii2-sentry)

PHPackages © 2026

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