Docs/Admin/Audit Logs

Audit Logs

A chronological record of every significant action taken in your Hygate workspace.


Overview

Audit logs create an immutable record of system activity. They support security investigations, compliance requirements, change management, and operational troubleshooting.


What's Logged

| Category | Examples | |---|---|---| | Authentication | Login, logout, failed login, password change, password reset | | 2FA | TOTP setup, email OTP sent, 2FA method changed | | User Management | User invited, role changed, user deactivated, user deleted | | Integrations | TTLock credentials updated, Shelly auth key changed, Stripe keys updated | | Door Operations | Door added, door deleted, door status changed, QR code regenerated | | Device Operations | Device added, device deleted, relay turned on/off, maintenance mode toggled | | Session Management | Session started, session force-ended, session marked failed, session recovered | | Settings | Branding updated, security policy changed, global defaults modified |


Reading a Log Entry

Each entry shows:

FieldDescription
ActionHuman-readable description (e.g., "Updated Stripe secret key")
UserEmail of the user who performed the action
TimestampWhen the action occurred (formatted: "07 May 2026, 14:32")
EntityThe type of object affected (e.g., "StripeConfig", "Door", "User")
Entity IDThe ID of the affected object
DetailsExpandable JSON with the full context of the change

Example Log Entry

Action:     Door status changed to Maintenance Mode
User:       admin@company.com
Timestamp:  07 May 2026, 14:32
Entity:     Door
Entity ID:  clx123abc
Details:    [Expandable JSON]

Details (Expanded JSON)

{
  "doorId": "clx123abc",
  "doorName": "Main Entrance",
  "previousStatus": "ACTIVE",
  "newStatus": "MAINTENANCE",
  "changedBy": "admin@company.com",
  "ipAddress": "192.168.1.42"
}

Filtering Logs

FilterDescription
Action typeFilter by category (e.g., all door operations)
Date rangeView logs from a specific time period

Key Events to Monitor

Security-Critical Events

EventWhat It Indicates
User login from new devicePotential account compromise
Failed login attemptBrute force attack
2FA method changedAccount takeover attempt
Security settings modifiedPolicy relaxation
Stripe keys updatedCredential rotation or compromise
User deactivatedAccess revocation

Operational Events

EventWhat It Indicates
Relay turned onSession started
Relay turned offSession ended
Maintenance mode enabledEquipment taken offline
Session force-ended by adminManual intervention
Door status changedOperational mode change

Integration Events

EventWhat It Indicates
TTLock credentials verifiedIntegration active
Shelly connection test failedConnectivity issue
Stripe webhook receivedPayment activity
Session recovered on startupServer restart or failure

Structured Logging

Hygate uses structured JSON logging for machine-readable events. Key events include:

EventWhen It Fires
payment_confirmedStripe webhook receives payment confirmation
duplicate_payment_ignoredWebhook received for already-processed payment
session_start_requestedSession creation requested
shelly_on_requestedRelay ON command sent to Shelly
shelly_on_successRelay ON confirmed
shelly_on_failedRelay ON command failed
session_activatedSession fully started (relay ON confirmed)
session_expiredSession timer reached zero
shelly_off_requestedRelay OFF command sent
session_endedSession completed normally
session_interruptedSession cancelled early
startup_recoveryStartup recovery action performed
reconciliationPeriodic reconciliation result
force_off_by_adminAdmin forced relay OFF

Compliance Benefits

Audit logs support compliance with common regulations:

BenefitDescription
Access auditingKnow who accessed the system, when, and from where
Change historyTrack every configuration change with before/after state
Incident reconstructionReplay the sequence of events leading to an issue
Regulatory evidenceProvide audit evidence for compliance audits
Security monitoringDetect suspicious patterns in user behavior

Retention

Audit logs are retained as long as the database is maintained. Contact your hosting provider for data retention policies.


Role Permissions

ActionAdministratorOperator
View audit logsYesNo
Export audit logsYesNo

Operators do not have access to audit logs. This prevents operational staff from viewing sensitive security events.