Skip to main content

Overview

Audit Logs provide a comprehensive, searchable record of all administrative actions and system events, ensuring transparency, accountability, and compliance.
All admin actions are automatically logged with timestamps, user IDs, IP addresses, and detailed descriptions.

Audit Logs Screen

Access the audit log viewer from the admin panel:
admin/presentation/screens/audit_logs_screen.dart

Log Entry Structure

Database Schema

Logged Actions

Actions:
  • admin_login - Admin logged in
  • admin_logout - Admin logged out
  • failed_login - Failed login attempt
  • session_expired - Session timeout
Icon: Login/LogoutColor: Green (#11998e)

Audit Log Screen Implementation

Search Functionality

admin/presentation/screens/audit_logs_screen.dart

Filter Chips

admin/presentation/screens/audit_logs_screen.dart

Log Card Display

admin/presentation/screens/audit_logs_screen.dart

Action Color Coding

admin/presentation/screens/audit_logs_screen.dart

Log Details Modal

admin/presentation/screens/audit_logs_screen.dart

Time Formatting

admin/presentation/screens/audit_logs_screen.dart

Creating Audit Log Entries

PHP Backend Implementation

backend/utils/audit_logger.php

Usage Example

Retrieving Audit Logs

Backend API Endpoint

backend/admin/get_audit_logs.php

Export Audit Logs

Export functionality is planned for future releases. Will support CSV and PDF formats for compliance reporting.

Retention Policy

Define how long to keep audit logs:

Best Practices

Ensure every administrative action is logged for complete audit trail.
Log not just what action was taken, but why and by whom, with before/after states.
Audit logs should be write-only for admins - no deletion or modification allowed.
Periodically review audit logs to identify suspicious patterns or security issues.
Maintain logs for required retention period for regulatory compliance.

Dashboard

View recent activity summary

User Management

User change tracking

Driver Management

Driver approval history