Purging the Activities log
By default, the Activities events log is purged daily at 2 AM. By modifying the EventLogPurgeJob task, you can specify the time that the log is purged and set the properties that define which entries can be deleted. Deleting old events helps maintain performance and keeps the log from becoming too large. Limiting the size of the event log table limits the database storage needed.
Before you begin
To edit configuration files, you must use the wsadmin client.
About this task
Customize how the log is purged by specifying the maxNumberOfDeletionPerCall and retentionInDays in the activities configuration file. Use maxNumberOfDeletionPerCall to set the maximum number of entries that are deleted at one time. Use retentionInDays to set how old an entry must be before it can be deleted.
Procedure
- Use the wsadmin client to access and check out the Activities
configuration file.
- Display the current Activities configuration settings.
Use the command
ActivitiesConfigService.showConfig()
to display a list of properties. Find the following properties from the EventLogPurgeJob task:- maxNumberOfDeletionPerCall
- The maximum number of log entries to delete per scheduled call. By default, 1000 entries are deleted each time that a purge runs. If invalid values are entered, the default value is used instead. If this value is blank, the default value is used.
- retentionInDays
- The minimum age of the entries to be deleted. By default, entries older than 365 days are deleted. The minimum value that is allowed for this property is 90 days. If a number less than 90 is entered, then the value that is used is the default of 90 days.
- Change the property values with the following command:
ActivitiesConfigService.updateConfig(property, value)
For example:ActivitiesConfigService.updateConfig("jobs.EventLogPurgeJob.maxNumberOfDeletionPerCall", "2000") ActivitiesConfigService.updateConfig("jobs.EventLogPurgeJob.retentionInDays", "365")
- Change the time that the task is run by editing the value
of the interval attribute. Use the following command:
ActivitiesConfigService.updateConfig(property, value)
For example, the following example sets the interval to
0 0 11 * * ?
, which runs the purge at 11 AM.ActivitiesConfigService.updateConfig("jobs.EventLogPurgeJob.interval", "0 0 11 * * ?")
- Before the changes can take effect, you must check in the configuration file. The configuration file must be checked in during the same wsadmin session in which you checked it out. See Applying property changes for details.
Example
<scheduledTasks>
...
<!-- EventLogPurgeJob - every day @ 2 AM -->
<task name="EventLogPurgeJob" description="Permanently removes Activities Event Log"
interval="0 0 2 * * ?" startby=""
enabled="true" scope="cluster" type="class"
targetName="com.ibm.openactivities.jobs.EventLogPurgeJobWS"
mbeanMethodName="" serverName="unsupported" >
<args>
<!-- The maximum number of log entries to delete per scheduled call (default 1000). Adjust this as needed. -->
<property name="maxNumberOfDeletionPerCall">1000</property>
<!-- The number of days that event log entries are retained. For example, only delete entries older than
now - X days. (default 365)
Note: This value must be equal to or greater than 90. Values less than 90 it are ignored and 90 is used. -->
<property name="retentionInDays">365</property>
</args>
</task>
...
<scheduledTasks>
What to do next
ActivitiesConfigService.updateConfig("jobs.EventLogPurgeJob.enabled", "false")