dhis2_export_audit_log
Extract complete audit logs in JSON format from DHIS2 health systems for compliance reporting and streamlined data management.
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)Handler for the dhis2_export_audit_log tool. Executes by calling auditLogger.exportAuditLog(), logs the operation, and returns the export data as formatted text 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)Core helper method that exports the audit log entries and summary as a JSON string. This is the primary logic behind the tool.exportAuditLog(): string { return JSON.stringify({ exportTimestamp: new Date().toISOString(), entries: this.entries, summary: this.getAuditSummary() }, null, 2); }