Skip to content

Audit Logs

The Logrite audit log system maintains a compliance audit trail of all service operations — every start, stop, restart, build, and configuration change.

  • Location: /root/logrite/logs/audit/
  • Format: JSON, one file per day
  • Filename: audit-YYYY-MM-DD.json
{
"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
}
}
FieldDescription
timestampISO 8601 UTC timestamp
actionWhat was done (see Action Types)
serviceWhich service (frontend, backend, etc.)
branchWhich branch (main, dev)
userOS username who ran the command
hostnameMachine hostname
sshClientSSH client IP (if connected remotely)
detailsAction-specific details
ActionDescription
service.startService started
service.stopService stopped
service.restartService restarted
service.buildService built
batch.start-allAll services started
batch.stop-allAll services stopped
rca.generatedRCA report generated
status.reportStatus report sent
Terminal window
# View last 20 entries
./cli/logrite-manager.js audit
# View last 50 entries
./cli/logrite-manager.js audit 50
# View raw log files
ls /root/logrite/logs/audit/
cat /root/logrite/logs/audit/audit-2026-03-02.json | jq .

Using the audit-log.js library:

const { logAudit, getRecentAuditEntries } = require('./lib/audit-log');
// Log an action
await logAudit('service.start', {
service: 'frontend',
branch: 'main',
details: { service: 'frontend' }
});
// Get recent entries
const entries = await getRecentAuditEntries(20);

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