Audit Logs
Overview
Section titled “Overview”The Logrite audit log system maintains a compliance audit trail of all service operations — every start, stop, restart, build, and configuration change.
Storage
Section titled “Storage”- Location:
/root/logrite/logs/audit/ - Format: JSON, one file per day
- Filename:
audit-YYYY-MM-DD.json
Log Entry Format
Section titled “Log Entry Format”{ "timestamp": "2026-03-02T08:15:32.441Z", "action": "service.start", "service": "frontend", "branch": "main", "user": "root", "hostname": "logrite-prod", "sshClient": "203.0.113.42", "details": { "service": "frontend", "port": 3000 }}Fields
Section titled “Fields”| Field | Description |
|---|---|
timestamp | ISO 8601 UTC timestamp |
action | What was done (see Action Types) |
service | Which service (frontend, backend, etc.) |
branch | Which branch (main, dev) |
user | OS username who ran the command |
hostname | Machine hostname |
sshClient | SSH client IP (if connected remotely) |
details | Action-specific details |
Action Types
Section titled “Action Types”| Action | Description |
|---|---|
service.start | Service started |
service.stop | Service stopped |
service.restart | Service restarted |
service.build | Service built |
batch.start-all | All services started |
batch.stop-all | All services stopped |
rca.generated | RCA report generated |
status.report | Status report sent |
Viewing Audit Logs
Section titled “Viewing Audit Logs”# View last 20 entries./cli/logrite-manager.js audit
# View last 50 entries./cli/logrite-manager.js audit 50
# View raw log filesls /root/logrite/logs/audit/cat /root/logrite/logs/audit/audit-2026-03-02.json | jq .Programmatic Access
Section titled “Programmatic Access”Using the audit-log.js library:
const { logAudit, getRecentAuditEntries } = require('./lib/audit-log');
// Log an actionawait logAudit('service.start', { service: 'frontend', branch: 'main', details: { service: 'frontend' }});
// Get recent entriesconst entries = await getRecentAuditEntries(20);Compliance Use Cases
Section titled “Compliance Use Cases”The audit trail supports:
- Change management — Who changed what and when
- Incident investigation — What operations preceded an outage
- Access tracking — Which IPs are managing the platform
- RCA enrichment — Audit entries feed into AI-generated RCA reports