Configuration of Audit Subsystem
As part of configuring it, you can choose between two implementations of the Audit Subsystem:
Direct Persistence implementation — The second version of the ThingWorx Audit Subsystem, which stores audit messages in the Persistence Provider configured for the ThingWorx Platform. The Persistence Provider can be a PostgreSQL or MS SQL database. This implementation is the recommended implementation, whether you have large or small audit data needs. To use this implementation, follow the instructions below to configure the Audit Subsystem.
Data Table implementation — The first version of the Audit Subsystem, which stores audit messages in system Data Tables. This version should be used with a PostgreSQL Persistence Provider. This implementation is the default when you first enable the Audit Subsystem. For best results, use the Direct Persistence implementation.
* 
PTC strongly encourages you to use the Direct Persistence implementation because the Data Table implementation will be deprecated in a future release of ThingWorx Platform. In addition, the QueryAuditHistory service will be deprecated in favor of the QueryAuditHistoryWithQueryCriteria service.
Once the Audit Subsystem is enabled, you can review, and if necessary, change the values of its operating parameters using ThingWorx Composer:
1. Assuming that you are logged in to ThingWorx Composer and have navigated to the AuditSubsystem pages, click Configuration.
The Configuration page for the AuditSubsystem in ThingWorx Composer follows:
Figure 11. AuditSubsystem Configuration in ThingWorx Composer, with Direct Persistence Enabled
2. Review the settings, and if necessary, change them, using the information in the table below for guidance. In particular, note that the check box for the Enable Direct Persistence for Audit Subsystem parameter is empty by default, which means that the Data Table implementation of the Audit Subsystem will be used. To use the Direct Persistence implementation, select this check box, as shown in the figure above.
3. After setting the parameters, click Save.
The following table describes the configuration parameters:
Configuration Parameters for the Audit Subsystem
Parameter
Description
Default Value
Valid Values
Enable Direct Persistence for Audit Subsystem
The switch between the Direct Persistence implementation and the Data Table implementation of the Audit Subsystem. Note that the Direct Persistence Provider works with PostgreSQL and MS SQL databases.
The Direct Persistence implementation of the Audit Subsystem (the check box is selected).
Check box selected — Direct Persistence implementation of the Audit Subsystem is used.
Check box cleared — Data Table implementation of the Audit Subsystem is used.
Audit Persistence Provider
This field cannot be changed. The default Persistence Provider for the ThingWorx Platform is used as the Persistence Provider for the Audit Subsystem. For the Data Table implementation, PostgreSQL is recommended for best performance. For the Direct Persistence implementation, use PostgreSQL or MS SQL.
ThingworxPersistenceProvider
The Persistence Provider for the Audit Subsystem is always the default ThingWorx Platform Persistence Provider. The Audit data is always persisted in the same database where all the other types of ThingWorx data are located.
Archive Audit Chunk Size
The number of rows that will be archived before a new chunk file is created
Over time, you may want to adjust the size, depending on volume, size of audit messages, and performance of the archive process.
50000
This setting can be any value greater than or equal to 10000 rows.
Maximum entries for online data (maxEntriesOnlineAuditData)
Data Table implementation — The maximum number of rows of online audit data that a Data Table can hold. The value is also used for archive files, the maximum number of rows to write to an archive file.
Direct Persistence implementation — The maximum number of rows of online audit data that an archive file can hold.
For details on how this parameter is used by theArchiveAuditHistoryDirectPersistenceand ArchiveAuditHistory (Data Table implementation) services, refer to Archiving and Purging Online Audit Data (Direct Persistence)or to Archiving and Purging Online Audit Data (Data Table)
500000 rows.
Positive numbers (integers) only. A negative value is not allowed.
Highest value that can be set for maxItems parameter for the QueryAudit History service
The maximum number of rows that can be set for the maxItems parameter of the QueryAudit History service.
5000
This value must be greater than or equal to 500 (N). The ThingWorx base type of this setting is INTEGER.
Number of days of online audit data to maintain.
The number of days to keep audit messages online. This value is used by the archive operation of the subsystem to determine which messages should be moved to the offline repository of the audit subsystem. Data that is older than this number of days is first copied to the offline storage. Then it is removed from online storage with a purge operation. More information can be found in the Archiving and Purging Audit Data topic and the Security for Audit Activities topic.
60 days.
INTEGER values only
* 
To view the subsystem values while it is running, go to Monitoring > Subsystems.
Was this helpful?