dhis2_export_audit_log
Export complete audit logs as JSON for compliance reporting and system monitoring in DHIS2 health information systems.
Instructions
Export complete audit log as JSON for compliance reporting
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/index.ts:1460-1477 (handler)The primary handler for the 'dhis2_export_audit_log' tool within the main tool call switch statement. It invokes the auditLogger's exportAuditLog method and formats the response.case 'dhis2_export_audit_log': const exportData = auditLogger.exportAuditLog(); auditLogger.log({ toolName: name, parameters: {}, outcome: 'success', dhis2Instance: dhis2Client?.baseURL, userId: currentUser?.username, executionTime: Date.now() - startTime }); return { content: [{ type: 'text', text: `📤 Audit Log Export\n\n${exportData}` }] };
- src/audit-logger.ts:98-104 (helper)The AuditLogger class method that generates a JSON string containing the audit entries, summary, and export timestamp. This is called by the tool handler.exportAuditLog(): string { return JSON.stringify({ exportTimestamp: new Date().toISOString(), entries: this.entries, summary: this.getAuditSummary() }, null, 2); }
- src/audit-logger.ts:113-113 (helper)The exported singleton instance of AuditLogger used throughout the application, including by the tool handler.export const auditLogger = new AuditLogger();
- src/index.ts:106-110 (registration)The ListToolsRequestSchema handler filters available tools based on permissions. The 'dhis2_export_audit_log' tool is included in the 'tools' array from createDevelopmentTools() and made available here.const filteredTools = PermissionSystem.filterToolsByPermissions(tools, userPermissions); return { tools: filteredTools, };