dhis2_clear_audit_log
Clear the DHIS2 audit log to remove old audit records and manage system storage. Requires confirmation before execution.
Instructions
Clear the audit log (requires confirmation)
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| confirmed | No | Set to true to confirm clearing the audit log |
Implementation Reference
- src/index.ts:1479-1487 (handler)The main handler for the 'dhis2_clear_audit_log' tool. It calls auditLogger.clear() to empty the audit log and returns a success confirmation message.case 'dhis2_clear_audit_log': auditLogger.clear(); return { content: [{ type: 'text', text: `🗑️ Audit log cleared successfully.` }] };
- src/audit-logger.ts:106-109 (helper)The clear() method of AuditLogger class that implements the core logic by resetting the entries array to empty and logging the action.clear(): void { this.entries = []; console.log('[AUDIT] Audit log cleared'); }
- src/audit-logger.ts:112-113 (helper)Global singleton instance of AuditLogger used by the tool handler.// Global audit logger instance export const auditLogger = new AuditLogger();