Enabling and disabling auditor at runtime

A guide to using auditor-bundle.

Enabling/Disabling at runtime


You can disable audit logging at runtime by calling DH\Auditor\Provider\Doctrine\Configuration::disableAuditFor(string $entity).
This will prevent the system from logging changes applied to $entity objects.

You can then re-enable audit logging at runtime by calling DH\Auditor\Provider\Doctrine\Configuration::enableAuditFor(string $entity).

To disable auditing for an entity, you first have to inject the dh_auditor.provider.doctrine service in your class, then use:


To enable auditing afterwards, use: