TsgcWSAPIKeyManagerMethods › ClearAuditLog

ClearAuditLog Method

Clears the audit log for a specific key or (when empty) for all keys.

Syntax

procedure ClearAuditLog(const aKey: string = '');

Parameters

NameTypeDescription
aKeyconst stringRaw plaintext key whose entries should be discarded. Pass an empty string to wipe the entire audit log.

Remarks

Destructive — removes every audit entry whose KeyPrefix matches the supplied key (or every entry when aKey is empty). The file-backed log (when Audit.LogFile is set) is truncated accordingly. Use it to honour a GDPR erasure request for a specific customer's key, or to shrink the log after exporting it to your SIEM. Does not affect the key store itself — the key continues to validate normally afterwards. Fires nothing (the clear action itself is not audited).

Example

// GDPR erasure for a single customer key
sgcWSAPIKeyManager1.ClearAuditLog(vKey);

// Wipe the entire audit log
sgcWSAPIKeyManager1.ClearAuditLog;

Back to Methods