PHPackages                             hevertonfreitas/cakephp-audit-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. hevertonfreitas/cakephp-audit-log

ActiveCakephp-plugin[Logging &amp; Monitoring](/categories/logging)

hevertonfreitas/cakephp-audit-log
=================================

A logging plugin for CakePHP. It takes a snapshot of the fully hydrated object after a change is complete and it also records each individual change in the case of an update action

4.0.0(6y ago)642.5k↓43.3%4MITPHPPHP &gt;=7.2

Since May 12Pushed 3y ago1 watchersCompare

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

READMEChangelog (8)Dependencies (3)Versions (13)Used By (0)

Audit Log Plugin
================

[](#audit-log-plugin)

[![Build Status](https://camo.githubusercontent.com/95d0dbba4f782285229f04c92f4c689a1c93269aea712729ecce69a8cfa6f018/68747470733a2f2f7472617669732d63692e6f72672f6865766572746f6e667265697461732f63616b657068702d61756469742d6c6f672e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/hevertonfreitas/cakephp-audit-log)[![Latest Stable Version](https://camo.githubusercontent.com/3dc5c307041958e5ee73933ca94ee74f9cdd60ac440569351fd4967b744c04a3/68747470733a2f2f706f7365722e707567782e6f72672f6865766572746f6e667265697461732f63616b657068702d61756469742d6c6f672f762f737461626c65)](https://packagist.org/packages/hevertonfreitas/cakephp-audit-log)[![Total Downloads](https://camo.githubusercontent.com/8c61f119bd1daffebc0242f23a8dce49c2fe3ee7a04019b130e757d999adb9bb/68747470733a2f2f706f7365722e707567782e6f72672f6865766572746f6e667265697461732f63616b657068702d61756469742d6c6f672f646f776e6c6f616473)](https://packagist.org/packages/hevertonfreitas/cakephp-audit-log)[![Latest Unstable Version](https://camo.githubusercontent.com/be9097001cc16ca0bce0e3c3b692a5e0ad0a6bb52ab3de4c377ad0622d5c82c1/68747470733a2f2f706f7365722e707567782e6f72672f6865766572746f6e667265697461732f63616b657068702d61756469742d6c6f672f762f756e737461626c65)](https://packagist.org/packages/hevertonfreitas/cakephp-audit-log)[![codecov](https://camo.githubusercontent.com/e090141530b5edcdd1b7da6f848fcf37e5f0160ade6ce623ef76aca2ab256fea/68747470733a2f2f636f6465636f762e696f2f67682f6865766572746f6e667265697461732f63616b657068702d61756469742d6c6f672f6272616e63682f6d61737465722f67726170682f62616467652e737667)](https://codecov.io/gh/hevertonfreitas/cakephp-audit-log)[![License](https://camo.githubusercontent.com/04ecc0c216509cfb2cd43cb3474100c6f31fa29929803e318bd8e28bb01c9970/68747470733a2f2f706f7365722e707567782e6f72672f6865766572746f6e667265697461732f63616b657068702d61756469742d6c6f672f6c6963656e7365)](http://opensource.org/licenses/MIT)

A logging plugin for [CakePHP](https://cakephp.org). The included `AuditableBehavior` creates an audit history for each instance of a model to which it's attached.

The behavior tracks changes on two levels. It takes a snapshot of the fully hydrated object *after* a change is complete and it also records each individual change in the case of an update action.

Features
--------

[](#features)

- Support for CakePHP 4.0
- Tracks object snapshots as well as individual property changes.
- Allows each revision record to be attached to a source -- usually a user -- of responsibility for the change.
- Allows developers to ignore changes to specified properties. Properties named `created`, `updated` and `modified` are ignored by default, but these values can be overwritten.
- Handles changes to HABTM associations.
- Does not require or rely on the existence of explicit models revisions (`AuditLog`) and deltas (`AuditLogDeltas`).

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

[](#installation)

You can install this plugin into your CakePHP application using [composer](https://getcomposer.org).

The recommended way to install composer packages is:

```
composer require hevertonfreitas/cakephp-audit-log

```

Load your plugin using

```
bin/cake plugin load AuditLog

```

or by manually putting `$this->addPlugin('AuditLog');` in the bootstrap method of your `src/Application.php`.

Then, run the necessary migrations

```
bin/cake migrations migrate -p AuditLog

```

### Next Steps

[](#next-steps)

1. Create a `currentUser()` method, if desired.

    The `AuditableBehavior` optionally allows each changeset to be "owned" by a "source" -- typically the user responsible for the change. Since user and authentication models vary widely, the behavior supports a callback method that should return the value to be stored as the source of the change, if any.

    The `currentUser()` method must be available to every model that cares to track a source of changes. It should return an array with a key `id` describing the primary key of the user that changed the record.

Usage
-----

[](#usage)

Applying the `AuditableBehavior` to a model is essentially the same as applying any other CakePHP behavior. The behavior does offer a few configuration options:

 `ignore` An array of property names to be ignored when records are created in the deltas table. `habtm` An array of models that have a HABTM relationship with the acting model and whose changes should be monitored with the model. If the HABTM model is auditable in its own right, don't include it here. This option is for related models whose changes are \_only\_ tracked relative to the acting model.License
-------

[](#license)

This code is licensed under the [MIT license](http://www.opensource.org/licenses/mit-license.php).

Notes
-----

[](#notes)

Feel free to submit bug reports or suggest improvements in a ticket or fork this project and improve upon it yourself. Contributions welcome.

###  Health Score

38

—

LowBetter than 85% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity35

Limited adoption so far

Community18

Small or concentrated contributor base

Maturity65

Established project with proven stability

 Bus Factor2

2 contributors hold 50%+ of commits

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 ~183 days

Recently: every ~175 days

Total

12

Last Release

1644d ago

Major Versions

2.3.3 → 4.0.02019-12-16

2.3.4 → 3.x-dev2021-11-16

PHP version history (3 changes)2.1.0PHP &gt;=5.4.16

2.2.0PHP &gt;=5.6.0

2.3.3PHP &gt;=7.2

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/2679081?v=4)[Heverton Coneglian de Freitas](/maintainers/hevertonfreitas)[@hevertonfreitas](https://github.com/hevertonfreitas)

---

Top Contributors

[![robwilkerson](https://avatars.githubusercontent.com/u/7735?v=4)](https://github.com/robwilkerson "robwilkerson (35 commits)")[![jippi](https://avatars.githubusercontent.com/u/22841?v=4)](https://github.com/jippi "jippi (30 commits)")[![rochamarcelo](https://avatars.githubusercontent.com/u/850748?v=4)](https://github.com/rochamarcelo "rochamarcelo (18 commits)")[![hevertonfreitas](https://avatars.githubusercontent.com/u/2679081?v=4)](https://github.com/hevertonfreitas "hevertonfreitas (17 commits)")[![jasonsnider](https://avatars.githubusercontent.com/u/209596?v=4)](https://github.com/jasonsnider "jasonsnider (14 commits)")[![wuilliam321](https://avatars.githubusercontent.com/u/236566?v=4)](https://github.com/wuilliam321 "wuilliam321 (4 commits)")[![lorenzo](https://avatars.githubusercontent.com/u/37621?v=4)](https://github.com/lorenzo "lorenzo (3 commits)")[![rchavik](https://avatars.githubusercontent.com/u/39490?v=4)](https://github.com/rchavik "rchavik (1 commits)")[![ptica](https://avatars.githubusercontent.com/u/169873?v=4)](https://github.com/ptica "ptica (1 commits)")[![CpuID](https://avatars.githubusercontent.com/u/916201?v=4)](https://github.com/CpuID "CpuID (1 commits)")[![hevertonwinsite](https://avatars.githubusercontent.com/u/125268572?v=4)](https://github.com/hevertonwinsite "hevertonwinsite (1 commits)")

---

Tags

logpluginloggingsecuritycakephpAudit

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/hevertonfreitas-cakephp-audit-log/health.svg)

```
[![Health](https://phpackages.com/badges/hevertonfreitas-cakephp-audit-log/health.svg)](https://phpackages.com/packages/hevertonfreitas-cakephp-audit-log)
```

###  Alternatives

[robwilkerson/cakephp-audit-log-plugin

Audit Plugin for CakePHP

10167.8k](/packages/robwilkerson-cakephp-audit-log-plugin)[lordsimal/cakephp-sentry

Sentry plugin for CakePHP

12270.3k](/packages/lordsimal-cakephp-sentry)[dereuromark/cakephp-databaselog

A CakePHP plugin for storing and viewing application logs in the database

44165.0k2](/packages/dereuromark-cakephp-databaselog)[muhammadsadeeq/laravel-activitylog-ui

A beautiful, modern UI for Spatie's Activity Log with advanced filtering, analytics, and real-time features.

17510.1k](/packages/muhammadsadeeq-laravel-activitylog-ui)[melihovv/laravel-log-viewer

A Laravel log viewer

1231.5k1](/packages/melihovv-laravel-log-viewer)

PHPackages © 2026

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