DamienHarper / auditor-bundle

The missing audit log library
MIT License
399 stars 121 forks source link

Duplicated audit entries #403

Open StonedPunk opened 9 months ago

StonedPunk commented 9 months ago

PHP Version: 8.2 damienharper/auditor-bundle: 5.2.5 mysql: 8.0.32

Summary The auditor's table duplicates all actions on the entity: update, create, delete

Inputs Using an example #251, I fixed the error of auditor records not being created. If I remove this, the records stop being created.

CONFIG dh_auditor: enabled: true providers: doctrine: auditing_services: - '@doctrine.orm.default_entity_manager' entities: App\Entity\License\License: enabled: true App\Entity\License\LicenseExtended: enabled: true App\Entity\License\LicenseOld: enabled: true

###> DH/Auditor-bundle ###
DH\Auditor\Provider\Doctrine\Auditing\Transaction\TransactionManager:
    arguments: [ '@DH\Auditor\Provider\Doctrine\DoctrineProvider' ]

DH\Auditor\Provider\Doctrine\Auditing\Event\DoctrineSubscriber:
    arguments: [ '@DH\Auditor\Provider\Doctrine\Auditing\Transaction\TransactionManager']
    tags:
        - { name: doctrine.event_subscriber, priority: 1000 }
###> DH/Auditor-bundle ###
durrentom commented 1 month ago

I'm facing the same issue, but only with APP_ENV=prod. PHP 8.1, Symfony 5.4

If I explicitly declare the services in services_prod.yaml, I get double entries. If I remove them, nothing gets logged.

In dev mode it works just fine, without any particular configuration.