Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ldaspt
Copy link

@ldaspt ldaspt commented Dec 17, 2024

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 DATA-DOG/DataDogAuditBundle#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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant