Custom Audit Trail
Overview
The Custom Audit Trail module creates a log history for the changes made to objects in your Mendix application.
Documentation
Introduction
The Custom Audit Trail module creates a log history for the changes made to objects in your Mendix application.
Typical Use Cases
This module keeps track of what changes are made in your Mendix application as well as when, by whom.
Features*
Keep track of objects that are created, changed, or deleted* Add a commit event which analysis and save the changes* Log the complete state of the entity (all attributes) or only the changed attributes by modifying a constant
Configuration
The below section describe the configuring steps this module.
Associations & Events
Add a before-commit, and before-delete event to your entity that is identical to the events
For entity create or change operation use “AuditLogBeforeCreate” action with following configuration parameters
- AuditableObject – Provide source entity object which consider for audit activity.
- ParentObject (Optional) -- Provide parent object for co-relational audit information.
- AuditOnCreate -- Select to audit single entry at creation time.
- AuditMembersOnCreate -- Select to audit for each member at creation time.
- AuditMembersOnChange -- Select to audit for each member at update time.
- AuditReferenceRecord -- Select to audit reference and reference set record.
- AuditMembersName (Optional) -- Create audit trail record for selected member only (i.e. Mem1,Mem2,Mem3)
- AuditExcludeMembers (Optional) -- Create exclude attribute list from audit trail (Mem1,Mem2,Mem3)
- AuditMembersAliasName (Optional) -- Change audit member name using alias name (i.e. Mem1:Alias1,Mem2:Alias2)
- AssociationMembersName (Optional) -- Association member name with full path included member name (Module.Associciation.Attribute1,Module.Associciation.Attribute2,..)
- UserFullName (Optional) -- Login user full name to track the name in audit log.
For entity delete operation use “AuditLogBeforeDelete” action with following configuration parameters
- AuditableObject – Provide source entity object which consider for audit activity.
- ParentObject -- Provide parent object for co-relational audit information (Optional).
- AuditOnDelete -- Select to audit single entry at delete time.
Changing Audit Behavior
Changing the audit behavior is easily done by altering the values of the following constants (if no value is set, the default is used):
- AuditLogServerTimeZone (default: true) – This determines if the date should be audited in the **ServerTimeZone**. If both the session time zone and **ServerTimeZone** are enabled, you will see two dates in the audit overview.
- ServerTimeZone (default: UTC) – This the time zone in which the server time zone is printed. This will be a static time zone and should match the notation as used in Java.
- AuditLogSessionTimeZone (default: false) – This determines if the date should be audited in the session time zone of the user that makes the change. If both the session time zone and the server time zone are enabled, you will see two dates in the audit overview.
- LogUseDecimalScientificNotation (default: True) - This determines if large decimal values will appear in scientific notation or be shown in full in the Audit log.
- AuditLogLineDateFormat (default: MM/dd/yyyy) – This constant determines the format to be used to convert date attributes to strings. It uses the same pattern as used by the Parse & Format Date Function Calls of Mendix (see https://docs.mendix.com/refguide/parse-and-format-date-function-calls).