Skip to content

Audit Log

The Audit Log is a complete, tamper-evident record of every significant action performed within GeniusHRM. It captures who did what, when, from which IP address, and what changed.


Accessing the Audit Log

Navigate to Admin Panel → Audit Log or go to /admin/audit-log. Only users with the Admin role can access the audit log by default. This can be adjusted via Roles & Permissions by granting the audit-log.view permission to other roles.


What Is Logged

The audit log captures the following event types across all modules:

Event TypeExample
CreatedNew employee added
UpdatedEmployee salary changed
DeletedLeave request cancelled
ApprovedLeave request approved
RejectedLeave request rejected
LoginUser logged in
LogoutUser logged out
Failed LoginInvalid password attempt
Password ResetPassword changed
Settings ChangedSMTP credentials updated
Payroll RunPayroll cycle started or approved
Role ChangedUser role updated
Permission ChangedRole permissions modified

Audit Log Entry Structure

Each log entry records:

FieldDescription
TimestampExact date and time of the action (UTC)
UserName and email of the user who performed the action
IP AddressClient IP address
ModuleWhich module was affected (e.g., Employees, Payroll)
ActionThe type of event (created, updated, deleted, etc.)
ResourceThe specific record affected (e.g., Employee #EMP-042)
Old ValuesPrevious field values (for updates)
New ValuesUpdated field values (for updates)

Example Log Entry

2026-04-03 14:22:11 UTC
User: Jane Smith (hr@geniushrm.test)
IP: 192.168.1.45
Module: Employees
Action: Updated
Resource: Employee #EMP-042 (John Doe)
Changes:
  - department: "Engineering" → "Product"
  - position: "Senior Developer" → "Lead Developer"

Filtering the Audit Log

The audit log supports multiple simultaneous filters to help you find specific events quickly.

Available Filters

FilterDescription
SearchFree-text search across user name, email, and resource description
UserFilter by specific user (dropdown of all users)
ModuleFilter by module (Employees, Payroll, Attendance, etc.)
ActionFilter by event type (created, updated, deleted, login, etc.)
Date FromShow entries from this date (inclusive)
Date ToShow entries up to this date (inclusive)
IP AddressFilter by specific client IP (useful for security investigations)

Using Date Range Filters

To view all payroll-related activity for a specific month:

  1. Set Module to Payroll
  2. Set Date From to 2026-04-01
  3. Set Date To to 2026-04-30
  4. Click Apply Filters

Viewing Change Details

For updated events, click View Changes to see a detailed diff:

  • Fields that were changed are highlighted
  • Old values are shown in red
  • New values are shown in green
  • Unchanged fields are not shown

Exporting the Audit Log

The audit log can be exported to CSV for archiving, compliance, or further analysis in spreadsheet tools.

Export Steps

  1. Apply any desired filters to narrow the data set
  2. Click Export CSV (top right of the log table)
  3. The file downloads immediately as audit-log-YYYY-MM-DD.csv

CSV Columns

timestamp,user_name,user_email,ip_address,module,action,resource,old_values,new_values

Compliance Archiving

For compliance purposes (e.g., GDPR, SOC 2), export the audit log monthly and store the CSVs in a secure, off-site location. GeniusHRM retains log entries indefinitely by default.


Configuring Log Retention

By default, audit log entries are retained indefinitely. To configure automatic purging of old entries, set the retention period in your .env file:

ini
AUDIT_LOG_RETENTION_DAYS=365

Then run the scheduled cleanup command (add this to your cron or Supervisor):

bash
php artisan audit:cleanup

Or schedule it in routes/console.php (Laravel 11+):

php
Schedule::command('audit:cleanup')->daily();

Security Considerations

The audit log is read-only from the admin UI. No user — including Admin — can delete or modify individual log entries through the application interface. This ensures log integrity.

Database Access

A user with direct database access could modify audit log entries. For high-security environments, consider using a separate audit log database with restricted write permissions, or forwarding logs to an external SIEM tool.


Monitoring Failed Login Attempts

To investigate potential brute-force attacks:

  1. Set Action filter to Failed Login
  2. Set a date range covering the suspicious period
  3. Look for multiple failed attempts from the same IP address
  4. If suspicious activity is found, use the IP address to block access at the web server or firewall level

Released under the MIT License.