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

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

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

ใช้ในการเก็บ Log ของ Active Record Model โดยเก็บเฉพาะฟิวดที่เปลียนแปลงเท่านั้น และแปลงข้อมูลเป็น string ทั้งหมดก่อนเก็บลง Log

v1.0.0(4y ago)0103MITPHPPHP &gt;=5.6.0

Since May 21Pushed 4y ago1 watchersCompare

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

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

yii2-log-field
==============

[](#yii2-log-field)

ใช้ในการเก็บ Log ของ Active Record Model โดยเก็บเฉพาะฟิวดที่เปลียนแปลงเท่านั้น และแปลงข้อมูลเป็น string ทั้งหมดก่อนเก็บลง Log

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

[](#installation)

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

Either run

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

```

or add

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

```

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

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

```
yii migrate/up --migrationPath=@vendor/patipark/yii2-log-field/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\yii2logfield\LogBehavior::class,
            ......
            ......
        ];
    }
```

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

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

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

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

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

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

ข้อมูลจะเก็บในตารางชื่อ yii2\_log\_field และเก็บข้อมูลของแต่ละฟิวด์ไว้ 1 record ต่อการเปลียนแปลง 1 ฟิวด์ โดยเก็บค่า before\_change,after\_change,table\_name,field\_name,primary\_key etc............

###  Health Score

23

—

LowBetter than 27% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity9

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

1818d 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 (5 commits)")

### Embed Badge

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

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

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