For the complete documentation index, see llms.txt. This page is also available as Markdown.

Log Rotation Setup

On-Prem Deployment Guide (Azure)

Why Log Rotation?

Docker containers generate logs continuously. Without rotation, logs can fill up disk space. Hivel services are configured with automatic log rotation that:

  • Creates daily log files with service name and date

  • Retains logs for 7 days

  • Automatically cleans up old logs

Setup Log Rotation

Goal: enable automatic daily log rotation and 7-day retention on the VM.

Prerequisites: hivel-onprem package present on the VM (Project Setup).

On the VM:

cd /opt/hivel-onprem
 
# Run setup script (requires sudo)
sudo ./scripts/setup-log-rotation.sh

This script will:

  • Create log directory structure (/var/log/hivel/)

  • Add daily cron job (runs at midnight)

  • Configure log rotation for all Docker containers

Expected result: see Verify Log Rotation Setup below.

If it fails: see Log rotation not working in Troubleshooting.

Verify Log Rotation Setup

Expected result: sudo crontab -l lists the rotation job; ls -la /var/log/hivel/ shows a directory per service.

Log File Locations

Logs are stored in:

Examples:

  • /var/log/hivel/auth-svc/auth-svc-2025-01-15.log

  • /var/log/hivel/insightly-svc/insightly-svc-2025-01-15.log

Viewing Logs

Log Retention

  • Retention Period: 7 days

  • Automatic Cleanup: Logs older than 7 days are automatically deleted

  • Daily Rotation: New log file created every day at midnight

Next step: Verification and Access - to confirm the deployment actually works end to end.

Last updated