You can add the SysTurnkeyTraceLog model pattern to an MDriven Turnkey application to retain an audit trail of user navigations and actions.
What SysTurnkeyTraceLog does
SysTurnkeyTraceLog, also referred to as SysTurnkeyTrace or TraceLog, is a model pattern for user-activity tracing in a Turnkey application. When Turnkey discovers the pattern in your model, it tracks the following events:
- Navigation â a user changes view.
- Action â an action-language execution that can result in a data change.
For each tracked event, Turnkey snapshots trace information into instances of the pattern's trace class. Turnkey then writes the collected instances to the database in batches.
Add the pattern to your model
Add the pattern before you need to review user activity; events that occurred before the pattern was present are not created as trace objects.
- Open your model in LiveEdit.
- Open the AssetsTK tab in the TK Live View.
- Locate the SysTurnkeyTraceLog pattern.
- Merge the pattern into the model.
- Deploy or run the model in Turnkey.
- Navigate between views and execute an action in the application.
- Inspect the persisted SysTurnkeyTraceLog objects in your model to verify that navigation and action events are being recorded.
For example, if a user opens one view and then runs an action that changes data, the pattern captures both the view change and the action execution as trace events.
Persistence interval and failure behavior
Turnkey accumulates trace events and spools them to the database every 30 seconds. This batching makes the trace collection efficient, but it also defines the recovery boundary.
If the server stops unexpectedly, the events still held in the current in-memory batch can be lost. Events that were already spooled to the database remain available as SysTurnkeyTraceLog objects.
| Situation | Trace result |
|---|---|
| A user navigates or executes an action | Turnkey snapshots the event into the current trace batch. |
| The 30-second spool occurs | Turnkey persists the batch as trace objects in the database. |
| The server stops before the next spool | Events in the unpersisted batch can be lost. |
Use the trace as an audit trail
Use this pattern when you need to understand what users did in a Turnkey application, such as which views they visited and which data-changing actions they executed. The persisted trace objects are part of your model, so you can build model-driven views or reports around them according to your application's audit requirements.
The pattern records application activity at navigation and action boundaries. Do not treat it as proof that every intermediate client-side interaction was persisted; the recorded units are the navigation and action snapshots described above.
Related pattern
The maintained pattern documentation is Documentation:SysTurnkeyTraceLog Pattern. That page describes the same trace-log pattern and notes that it is available in the MDriven components repository.
See also
- Documentation:SysTurnkeyTraceLog Pattern
- Documentation:Turnkey
- Documentation:Span.TurnkeyTimeoutMinutes
Compliance and audit-trail use
Compliance and audit-trail use
SysTurnkeyTrace is a model pattern for catching usage of a Turnkey application. It is also referred to as TraceLog or user audit.
When Turnkey discovers the pattern, it tracks actions and navigations. Trace information is spooled to the database as SysTurnkeyTrace objects.
Add the pattern
The pattern is available on GitHub and can be merged into a model from the LiveEdit AssetsTK tab. The related SysTurnkeyTraceLog Pattern documentation also describes merging the pattern from TK Live View.
After merging the pattern, run the Turnkey application and verify its behavior for representative navigations and actions in the application.
Documented event scope
The SysTurnkeyTraceLog Pattern documentation describes the following behavior:
- A navigation is a change of view.
- An action is an action-language execution resulting in a potential data change.
- Information is snapshotted for every navigation and action.
- MDrivenTurnkey spools objects of the pattern class every 30 seconds.
| Area | Documented behavior | Not specified in the documentation |
|---|---|---|
| Navigation | Information is snapshotted for each change of view. | The fields included in the snapshot. |
| Action | Information is snapshotted for each action-language execution resulting in a potential data change. | Whether individual object changes, attribute changes, or before-and-after values are recorded. |
| Persistence | Pattern objects are spooled to the database every 30 seconds. | Whether trace persistence is coordinated transactionally with a business-data change. |
| Server failure | A downed server can lose the current batch of trace. | Any recovery mechanism for an unspooled batch. |
Account for the spool interval
Trace is accumulated before it is spooled. The documentation warns that a downed server can lose the current batch of trace. Therefore, activity in the current, unspooled batch can be unavailable after a server failure.
Test the pattern with representative application behavior:
- Perform a navigation and an action in the Turnkey application.
- Allow for the documented 30-second spool interval.
- Verify that
SysTurnkeyTraceobjects are present in the database. - Define the expected handling if the server stops before the next spool interval.
Review before making audit or compliance claims
The documented pattern describes usage tracing, navigation and action snapshots, database spooling, and the server-failure risk for the current batch. It does not document the exact trace fields, retention, access control for trace objects, immutability, encryption, or recovery of an unspooled batch.
Before relying on the pattern for a particular audit or compliance requirement, confirm that the deployed model and database provide the evidence and controls required for that requirement.
