Monitoring & Logs
Health endpoint
GET /api/healthReturns a JSON status:
json
{
"status": "ok",
"database": "ok",
"storage": "ok"
}Use this endpoint with external monitoring systems (e.g., Uptime Kuma).
Log streams
Clavis writes four log files:
| Stream | Path | Content |
|---|---|---|
audit.log | /logs/audit.log | Security-relevant events (HMAC chain) |
app.log | /logs/app.log | Application logs |
error.log | /logs/error.log | Errors and exceptions |
access.log | /logs/access.log | HTTP requests |
Logs are stored in the Docker volume clavis_logs and are rotated daily.
Retention periods
| Stream | Retention |
|---|---|
| Audit logs | 365 days |
| App logs | 90 days |
| Error logs | 90 days |
| Access logs | 90 days |
Log cleanup
The cleanup script removes logs past their retention period:
bash
deployment/scripts/log-cleanup.shRecommended as a daily cron job:
bash
# crontab -e
0 4 * * * /path/to/App/deployment/scripts/log-cleanup.shExternal monitoring
Recommendation: Uptime Kuma on a separate server, polling the health endpoint every 60 seconds and sending alert notifications (e.g., Telegram).