I understand the Platform provides many mechanisms for storing logs and audit data. What are the various ways to log data, and which approaches are more useful in specific scenarios?
In this recipe we cover a few logging mechanisms readily available in the Platform and link to relevant content.
Accessed via the LOGGER function, this should be used for debug/trace logs, which should normally not contain sensitive data. A separate log output file can be configured in order to record process state changes, security events (e.g. user logins etc), or sensitive data via the log4j configuration.
Normally used in 'mutation' processes, the DataAuditTrail extension could also be used in opening/creation processes. It records all changes to objects of a specified set of classes, in particular:
- The subject of the change (the entity whose property was changed)
- The previous and new values of the property
- Information about who performed the change
- Information about when the change took place
Changes are saved in the value store itself (in the form of a new class) and must be persisted at some stage in the process (e.g. to a specific log file).
The ProcessAuditTrail extension records events generated by the process engine, and stores them in a relational database.
The extension can store data about token creations and completions, related activity names, and users involved. If such information needs to be logged to standard log files, it may be easier to do the logging via explicit scripts in the process. Otherwise, when using the extension, there needs to be some automation in place to convert the data stored in the database to log files.
BAM, short for "Business Activity Monitoring", was designed to help create tools for monitoring of process instances, but lends itself well to process auditing.
BAM's unique feature is the ability to attach "listeners" (called "trackpoints") to any activity in the process editor, and specify attributes to be recorded when the activity is executed. For example, you could record the activity name, user, and time once an activity starts, or even values from the data model. Attributes are stored in a relational database.