PHPackages                             kikwik/doctrine-entity-logger-bundle - 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. kikwik/doctrine-entity-logger-bundle

ActiveSymfony-bundle[Logging &amp; Monitoring](/categories/logging)

kikwik/doctrine-entity-logger-bundle
====================================

Listener for doctrine entity changes

v0.4.1(5mo ago)060MITPHPPHP &gt;=8.1

Since Apr 30Pushed 5mo ago2 watchersCompare

[ Source](https://github.com/kikwik/doctrine-entity-logger-bundle)[ Packagist](https://packagist.org/packages/kikwik/doctrine-entity-logger-bundle)[ RSS](/packages/kikwik-doctrine-entity-logger-bundle/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (3)Dependencies (6)Versions (16)Used By (0)

KikwikDoctrineEntityLoggerBundle
================================

[](#kikwikdoctrineentityloggerbundle)

> ⚠️ **Note:** This bundle is a work in progress and may be subject to changes.

The **KikwikDoctrineEntityLoggerBundle** is a Symfony bundle designed to log changes made to Doctrine entities. With this bundle, you can easily track modifications to your database entities and maintain a historical record of changes in a dedicated table.

#### Key Features:

[](#key-features)

- Automatic logging of updates, inserts, and deletions for Doctrine entities.
- Stores change history in a database table (`kw_entity_log`) for easy access and review.
- Integrates seamlessly with Symfony projects.

This bundle enables quick and effective logging of entity changes, making it a valuable tool for projects requiring audit trails or entity history tracking.

This bundle is inspired by the [manasbala/doctrine-log-bundle](https://github.com/manasbala/doctrine-log-bundle) and the [gedmo/doctrine-extensions](https://github.com/doctrine-extensions/DoctrineExtensions/blob/main/doc/loggable.md) projects.

The tests for this bundle were developed with the help of the following article: [Symfony functional tests for standalone bundles](https://medium.com/@fico7489/symfony-functional-tests-for-standalone-bundles-9666045a2309).

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

[](#installation)

Make sure Composer is installed globally, as explained in the [installation chapter](https://getcomposer.org/doc/00-intro.md)of the Composer documentation.

Open a command console, enter your project directory and execute:

```
$ composer require kikwik/doctrine-entity-logger-bundle
```

Update the database to create the logger table (kw\_entity\_log):

```
$ php bin/console make:migration
$ php bin/console doctrine:migrations:migrate
```

> ⚠️ **Note:** In version v0.3.0 the entity definition has changed, be sure to make and run your migration

Configuration
-------------

[](#configuration)

Create the config file in `config/packages/kikwik_doctrine_entity_logger.yaml` wich has these defaults:

```
kikwik_doctrine_entity_logger:
    enabled: true
    global_excluded_fields: ['createdAt', 'updatedAt', 'createdBy', 'updatedBy', 'createdFromIp', 'updatedFromIp']
```

Usage
-----

[](#usage)

Add the `\Kikwik\DoctrineEntityLoggerBundle\Attributes\LoggableEntity` attribute to the entities you want to log

```
namespace App\Entity;

use Doctrine\ORM\Mapping as ORM;
use Kikwik\DoctrineEntityLoggerBundle\Attributes\LoggableEntity;

#[ORM\Entity(repositoryClass: MyEntityRepository::class)]
#[LoggableEntity]
class MyEntity
{
    // ...
}
```

Disabling log
-------------

[](#disabling-log)

If you want to enable or disable logger at run-time inject the `Kikwik\DoctrineEntityLoggerBundle\Service\EntityLoggerConfig` service and call the `setEnabled` method:

```
namespace App\Command;

use Kikwik\DoctrineEntityLoggerBundle\Service\EntityLoggerConfig;

class DoSomethingCommand extends Command
{
    public function __construct(
        private EntityLoggerConfig $entityLoggerConfig,
    )
    {
        parent::__construct();
    }

    protected function execute(InputInterface $input, OutputInterface $output): int
    {
        $this->entityLoggerConfig->setEnabled(false);
        //...
    }
}
```

Easy Admin
----------

[](#easy-admin)

If you are using easy admin you can create a ready-to-use Crud controller by extending `KikwikLogCrudController`:

```
namespace App\Controller\Admin;

use Kikwik\DoctrineEntityLoggerBundle\EasyAdmin\KikwikLogCrudController;

class LogCrudController extends KikwikLogCrudController
{

}
```

Then add the entity log controller to your dashboard

```
namespace App\Controller\Admin;

use Kikwik\DoctrineEntityLoggerBundle\Entity\Log;

class DashboardController extends AbstractDashboardController
{
    public function configureMenuItems(): iterable
    {
        // ....

        yield MenuItem::section('Log');
        yield MenuItem::linkToCrud('Log azioni', 'fas fa-history', Log::class);
    }
}
```

And add the `LogField` to your loggable controller

```
namespace App\Controller\Admin;

use Kikwik\DoctrineEntityLoggerBundle\EasyAdmin\LogField;

class MyCrudController extends AbstractCrudController
{
    public function configureFields(string $pageName): iterable
    {
        // ...

        yield LogField::new('log'); // 'log' is a dummy name
    }
}
```

###  Health Score

36

—

LowBetter than 81% of packages

Maintenance77

Regular maintenance activity

Popularity9

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity43

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

Every ~16 days

Recently: every ~42 days

Total

15

Last Release

154d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/4bdd98919c8ee6645e854e72f8c6b76c503e12fd10078fb34ae1668cb2bd6d1a?d=identicon)[kikwik](/maintainers/kikwik)

---

Top Contributors

[![kikwik](https://avatars.githubusercontent.com/u/58590255?v=4)](https://github.com/kikwik "kikwik (32 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/kikwik-doctrine-entity-logger-bundle/health.svg)

```
[![Health](https://phpackages.com/badges/kikwik-doctrine-entity-logger-bundle/health.svg)](https://phpackages.com/packages/kikwik-doctrine-entity-logger-bundle)
```

###  Alternatives

[sylius/sylius

E-Commerce platform for PHP, based on Symfony framework.

8.4k5.6M647](/packages/sylius-sylius)[sulu/sulu

Core framework that implements the functionality of the Sulu content management system

1.3k1.3M152](/packages/sulu-sulu)[prestashop/prestashop

PrestaShop is an Open Source e-commerce platform, committed to providing the best shopping cart experience for both merchants and customers.

9.0k15.4k](/packages/prestashop-prestashop)[sulu/skeleton

Project template for starting your new project based on the Sulu content management system

29733.3k](/packages/sulu-skeleton)[open-dxp/opendxp

Content &amp; Product Management Framework (CMS/PIM)

7310.3k29](/packages/open-dxp-opendxp)[rcsofttech/audit-trail-bundle

Enterprise-grade, high-performance Symfony audit trail bundle. Automatically track Doctrine entity changes with split-phase architecture, multiple transports (HTTP, Queue, Doctrine), and sensitive data masking.

1022.4k](/packages/rcsofttech-audit-trail-bundle)

PHPackages © 2026

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