Skip to content

Commit

Permalink
Wording
Browse files Browse the repository at this point in the history
  • Loading branch information
DamienHarper committed Jan 21, 2019
1 parent 5a7d844 commit 2068c51
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -246,12 +246,16 @@ services:
class: App\CustomUserProvider
````

### Disable auditing in runtime
### Disable auditing at runtime

If you have a situation where you need to disable audit logging for some specific operation (like an automated
process), you can do this by injecting the `dh_doctrine_audit.configuration` service in your class.
You can disable audit logging at runtime by calling `AuditConfiguration::disableAuditFor(string $entity)`
This will prevent the system from logging changes applied to `$entity` objects.

To disable auditing for an entity, use:
You can then re-enable audit logging at runtime by calling `AuditConfiguration::enableAuditFor(string $entity)`

**Warning:** disabling audit logging for an entity will make its audit logs incomplete/partial (no change applied to specified entity is logged in the relevant audit table while audit logging is disabled for that entity).

To disable auditing for an entity, you first have to inject the `dh_doctrine_audit.configuration` service in your class, then use:

````php
$auditConfiguration->disableAuditFor(MyAuditedEntity1::class);
Expand All @@ -263,7 +267,7 @@ To enable auditing afterwards, use:
$auditConfiguration->enableAuditFor(MyAuditedEntity1::class);
````

You can also have an entity that is not audited by default and only enable auditing when you need it. To do so, add
You can also disable audit logging for an entity by default and only enable auditing when needed. To do so, add
this to your configuration file:

````yml
Expand All @@ -276,6 +280,7 @@ dh_doctrine_audit:
This will create the audit table for this entity, but will only save audit entries when explicitly enabled as shown
above.


Usage
=====

Expand Down Expand Up @@ -337,6 +342,7 @@ FAQ:

> Check the [Custom user provider](#custom-user-provider) section.


License
=======

Expand Down

0 comments on commit 2068c51

Please sign in to comment.