auditor icon indicating copy to clipboard operation
auditor copied to clipboard

[DRAFT] Add support for Storing audit logs in a single table

Open ldaspt opened this issue 1 year ago • 1 comments

The goal is to allow storing all audit logs in a single table instead of creating a separate table for each audited entity.

I am aware of the performance issues that this can cause on an application with a large volume https://github.com/DATA-DOG/DataDogAuditBundle/issues/32

This PR is a work in progress to validate the design and approach.

I test the feature on the demo https://github.com/DamienHarper/auditor-bundle-demo by adding in config/services.yaml

    app.doctrine_single_table:
        class: DH\Auditor\Provider\Doctrine\Service\SingleTableDoctrineService
        decorates: dh_auditor.provider.doctrine.storage_services.doctrine.orm.default_entity_manager
        arguments: ['@.inner', 'audit']

Work Remaining:

  • [ ] Add tests to cover the new feature.
  • [ ] Modify schema structures to support a single audit table.
  • [ ] Update the Clean audit tables and Update audit tables commands to support this feature.
  • [ ] Enable the feature via the bundle configuration
  • [ ] Update the audit table property of the event payload

ldaspt avatar Dec 17 '24 11:12 ldaspt