← Back to plugin index

User Trail Log Clean-up Task

Description

Task to clean up stale user trail log entries from the database.

It is recommended to schedule this task during a time with little traffic. Depending on the number of stale user trail logs, the task may take some time to complete.

Note: The clean up task ignores tenant IDs, all stale log are deleted regardless of their tenant IDs.

Type name
UserTrailLogCleanupTask
Class
com.airlock.iam.servicecontainer.app.application.configuration.task.usertrail.UserTrailLogCleanupTaskConfig
May be used by
Properties
Database Repository (databaseRepository)
Description
Defines the user trail log database from which expired log entries are to be removed.
Attributes
Plugin-Link
Mandatory
Assignable plugins
Log Retention Time (logRetentionTime)
Description

Duration to keep user trail log entries in the database after creation.

Log entries that are older than the specified duration are considered stale and will be removed at the next scheduled clean-up time.

Attributes
String
Optional
Default value
90d
Example
7d
Example
14d 12h
Batch Size (batchSize)
Description

During clean-up, user trail log entries are deleted in batches of this size.

This ensures that any row locks on the database are very short-lived, not affecting parallel log insertions. This value should not be set too high to prevent very long running transactions. User trail log clean-up will repeat deleting this number of logs until all logs not within the retention time have been cleaned up. Therefore, this task can take some time when a lot of user trail logs are present.

This size should be chosen so that every batch does not take longer than 5 seconds. The average runtime of the batches can be found in the task's logs.

Attributes
Integer
Optional
Default value
1000
YAML Template (with default values)

type: UserTrailLogCleanupTask
id: UserTrailLogCleanupTask-xxxxxx
displayName: 
comment: 
properties:
  batchSize: 1000
  databaseRepository:
  logRetentionTime: 90d