Skip to main content
A newer version of this page is available. .
.NET Framework 4.5.2+

Change Object Auditing Mode

The Audit Trail System supports several object auditing modes.

Mode Description
Full All object changes are fully audited. This mode is the default.
Lightweight Only object creation, deletion and modification are audited. This mode does not audit names and values of changed properties.
CreationOnly Only object creation is audited. Intended for data import purposes.

To change the current object auditing mode, set the AuditTrailService.Instance.ObjectAuditingMode property to one of the ObjectAuditingMode enumeration values. The following code demonstrates how this can be implemented.

XAF Windows Forms Application - Program.cs (Program.vb) file:

static void Main() {
    MySolutionWindowsFormsApplication application = new MySolutionWindowsFormsApplication();
    // ...
    AuditTrailService.Instance.ObjectAuditingMode = ObjectAuditingMode.Lightweight;
    application.Setup();
    application.Start();
    //...
}

XAF ASP.NET Application - Global.asax.cs (Global.asax.vb) file:

protected void Session_Start(object sender, EventArgs e) {
    WebApplication.SetInstance(Session, new MySolutionWebApplication());
    AuditTrailService.Instance.ObjectAuditingMode = ObjectAuditingMode.Lightweight;
    //...
    WebApplication.Instance.Setup();
    WebApplication.Instance.Start();
}