The audit trail registers all access and database changes, but it does have some limitations. To enable an audit trail, you must set the appropriate properties in the root component (registers access) and the dbtable components (registers database access, old value versus new value). What it cannot do is maintain changes of SQL statements. Therefore the DBQuery and DBSimpleQuery provide no means for audit trail. However, there is a generic function to add records to the log by yourself. 


public function auditLog($action, $appid, $message='') ;


It is part of the cRoot component and can log anything you require. But you need to write code to use it.


  • Creating the audit trail tables and class

If you want to use the audit trail, you can use the 'Audit Trail' button to create these modules if you haven't already.

This module works similarly to the RBA module. Just follow the steps from left to right to create the table and get the required audit class. 


Remark: if you enable audit trail in one of the components but have not created a class, you will get a fatal error while generating code.