Disable the Audit Trail Module
This topic demonstrates two options you can use to disable the Audit Trail Module in your application:
- In a Configuration File
Disable the Module unconditionally. - In Application Code
Disable the Module for a particular scenario.
In a Configuration File
Add the EnableAuditTrail key with the False value to an application’s configuration file, as shown below:
<appSettings>
<!-- ... -->
<add key="EnableAuditTrail" value ="False"/>
<!-- ... -->
</appSettings>
In Application Code
Access the Audit Trail Module and specify its AuditTrailModule.Enabled property in the XafApplication.LoggedOn event handler, as shown below:
using DevExpress.ExpressApp.Win;
using DevExpress.ExpressApp.AuditTrail;
// ...
public class MySolutionWinApplication : WinApplication {
// ...
protected override void OnLoggedOn(LogonEventArgs args) {
base.OnLoggedOn(args);
AuditTrailModule auditTrailModule = this.Modules.FindModule<AuditTrailModule>();
if(Security.UserName == "John")
auditTrailModule.Enabled = false;
}
}
}