-
Notifications
You must be signed in to change notification settings - Fork 2
Advanced Topics Audity
Roi Shabtai (saturn) edited this page Sep 28, 2020
·
6 revisions
Using AnyService
you are able to create complete audit log for every entity configured.
Audit data is persist to AuditRecord
and can be fetched using __audit
endpoint.
There are 4 types of audit records:
-
Create
- Created once, whenever an entity is created -
Read
- Created multiple times, every time the entity is fetched -
Update
- Created multiple times, every time the entity is updated -
Delete
- Created once, whenever an entity is deleted
To set an entity as auditable, it must inherit from one of the following interfaces:
ICreatableAudit
IReadableAudit
IUpdatableAudit
IDeletableAudit
-
IFullAudit
- Contains all audit types
AuditSettings
configures how audit is handled and is configured by settings the AuditSettings
property in AnyServiceConfig
.
Audit may makes the traffic to the persistency layer expensive. It can be deactivate entirely, per entity and or per audit type
- To deactivate audit entirey on server level, set the
AuditSettings.Active
property tofalse
. This step deactivates all audit behavior - To deactivate per audit type
-
Server level deactivation is done by seting the values of
AuditSettings.AuditRules
inAnyServiceConfig
's tofalse
(by audit type) -
Entity level deactivation is done by seting the values of
AuditSettings.AuditRules
in entity'sEntityConfigRecord
tofalse
(by audit type). Note that server level'sAuditRules
are overriden by entity'sAuditRules