Customizing Operator Advisor > Logging Historical Data > Disabling the Logging of Historical Data
Disabling the Logging of Historical Data
If the logging of large amounts of historical data is causing performance issues, you can disable the comprehensive logging of historical data. Disabling limits the logging to only those actions that are required by other functionality. Out-of-the-box, when the comprehensive logging is disabled, the only historical data logged is the execution status of work definitions when they are created and updated. The set of limited actions that are logged when comprehensive logging is disabled can be configured.
Disabling Logging
To disable the comprehensive logging of historical data, complete the following steps:
1. In ThingWorx Composer, navigate to the historical data manager Thing (PTC.SCA.SCO.HistoricalDataManager).
2. Under Services, find and override the LogHistoricalData service.
3. In the script editor, change the true setting to false:
var result = false;
4. Click Done, then click Save to save the updated service.
Configuring the Limited Set of Actions
To configure the limited set of actions that are logged when the comprehensive logging of historical data is disabled, complete the following steps:
1. In ThingWorx Composer, navigate to the historical data manager Thing (PTC.SCA.SCO.HistoricalDataManager).
2. Under Services, find and override the GetHistoricalDataLogConfig service.
3. In the script editor, add an entry in the designated custom configuration area for each additional event that you want to be logged. Do not change or remove the default configuration entries which log the ExecutionStatus field value when work definitions (PTC.SCA.SCO.WorkDefinition) are created or updated without an understanding of the impacts on other functionality.
Entries use the following format:
addLoggingConfiguration("<Data_Shape>", "<field>", "<action>");
For each <action>, the possible <field> values are:
CREATE—The name of the field, ALL, or nothing
UPDATE—The name of the field, or ALL
DELETE—Nothing
The following table provides example entries for the different events that can be logged:
Event to be Logged
Example Entry
Creation of an entity (A row is added to the database table)
addLoggingConfiguration("PTC.SCA.SCO.WorkDefinition", "CREATE");
Creation of an entity and the initial value for each field (A row is added to the database table, and each field that has a value when the row is added)
addLoggingConfiguration("PTC.SCA.SCO.WorkDefinition", "ALL", "CREATE");
Initial value of a a specific field when the entity is created (The specified field has a value when the row is added to the database table)
addLoggingConfiguration("PTC.SCA.SCO.JobOrder", "ID", "CREATE");
Update of the value for a specific field (The specified field value changes in the database table)
addLoggingConfiguration("PTC.SCA.SCO.JobOrder", "PlannedEndTime", "UPDATE");
Update of the value for all fields (Any field value changes in the database table)
addLoggingConfiguration("PTC.SCA.SCO.JobOrder", "ALL", "UPDATE");
Deletion of an entity (A row is removed from the database table)
addLoggingConfiguration("PTC.SCA.SCO.JobOrder", "DELETE");
4. Click Done, then click Save to save the updated service.
Was this helpful?