Audit

The Audit module tracks changes made to content items.

Setting up the audit module

The Audit Module requires creating of the Audits table in the database, to do this you can run /Lynicon/Admin/SQL/AddAudit.sql

Configuring the audit module

.UseModule<Auditing>(TimeSpan.FromDays(30))

.UseModule<Auditing>(TimeSpan.FromDays(30), (Func<Type, bool>)(t => !(new Type[] { typeof(User), typeof(SpecsDocContent) }.Contains(t)))


The audit module has two parameters:

  • KeepFor is a TimeSpan indicating how long an audit record should be kept for.  Every time the audit module starts up, it purges records older than this.
  • ApplyToType is a function from Type to bool returning true if the content type should be audited.

Audit table in database

The Audits table in the database stores the change records:

 

FieldDescription
IdThe table primary key
DateThe date/time of a change
UserIdThe id of the user who made the change
ItemIdThe identity of the content item changed
DataTypeThe full name of the content type of the item changed
VersionThe serialized ItemVersion of the content item changed
ChangeAny information about the actual change
ChangeTypeIndicates U - update D - delete A - add