Audit Log Archive

The database table called Form.AuditLogArchive reduces the number of records in the Form.AuditLog table to improve application performance.

Once the number of entries in the Form.AuditLog reaches a maximum size, the oldest entries are moved from the Form.AuditLog database table to the Form.AuditLogArchive database table in a "batch" at a configured interval. The batches are configurable as ArchiveMaxBatchSize and ArchiveMinBatchSize.

The Form.AuditLogArchive table also has a configured maximum size. Oldest entries are deleted from the Form.AuditLogArchive table to ensure it does not grow beyond this maximum size.

These settings are only accessible directly from the K2 database. 

Configuration

The configuration values have been added in a new database table called “Form.Configuration”. Below is a summary of these new configuration values and their default values:

Configuration value

Description

Default

Forms.Data.AuditLog.ArchiveMaxBatchSize

Maximum number of entries moved to the Archive table per Audit log call

100

Forms.Data.AuditLog.ArchiveMinBatchSize

Minimum number of entries exceeding the threshold, before any entries are moved to the Form.AuditLogArchive table Note: Should be smaller than MaxBatchSize

20

Forms.Data.AuditLog.MaxSize

The Form.AuditLog size before items will be considered to be moved to the Form.AuditLogArchive table. Items will only be moved when the Form.AuditLog table is equal to or larger than this MaxSize plus the ArchiveMinBatchSize

1000

Forms.Data.AuditLog.ArchiveMaxSize

The maximum size of the Form.AuditLogArchive database table. Oldest entries will be deleted first to ensure the table does not grow beyond this size.

10000

Forms.Data.AuditLogArchiveInterval This value specifies the time interval in minutes at which Audit log archiving checks occur. The SourceCode.Forms.Runtime.config is located at : [K2 installation folder]\Host Server\Bin\SourceCode.Forms.Runtime.config 60

Performance Implications

When configuring the audit log archive there are a few performance implications to consider.

  1. ArchiveMinBatchSize
    1. If it is set too low, this would result in more frequent database statements being executed (statements for moving the items to Archive table).This would affect more AuditLog database writes.
    2. If it is set too high this will result in less AuditLog writes being affected with additional SQL statements being executed, but the ones that are affected will take a longer period of time to complete due to the larger number of entries having to be moved when the limit has been reached.
  2. Changing the ArchiveMaxBatchSize will only affect users if they have a large number of AuditLog entries that have not yet been moved to the ArchiveTable. Once all the excess entries have been moved only the ArchiveMinBatchSize will further determine the effect on the performance.
  3. Increasing the AuditLog Max size or AuditLogArchive max size can degrade system performance. A significant decrease in performance can occur once an AuditLog grows over 100 000 entries.