| Log | Location | Content |
|---|---|---|
| Django errors | /var/www/yealinbilling/logs/django-errors.log | ERROR level and above |
| Gunicorn access | /var/www/yealinbilling/logs/gunicorn-access.log | HTTP requests |
| Gunicorn errors | /var/www/yealinbilling/logs/gunicorn-error.log | Gunicorn errors |
| Celery worker | /var/www/yealinbilling/logs/celery-worker.log | Task execution |
| Celery beat | /var/www/yealinbilling/logs/celery-beat.log | Scheduled tasks |
| Nginx access | /var/log/nginx/access.log | All HTTP requests |
| Nginx errors | /var/log/nginx/error.log | Nginx errors |
| Systemd | journalctl | All systemd service logs |
# Follow a log in real time
tail -f /var/www/yealinbilling/logs/gunicorn-access.log
# Last 100 lines
tail -100 /var/www/yealinbilling/logs/django-errors.log
# Search for errors
grep -i "error" /var/www/yealinbilling/logs/django-errors.log | tail -20
# Search for specific customer
grep "CRIP PTY LTD" /var/www/yealinbilling/logs/gunicorn-access.log
# Systemd logs (most reliable)
sudo journalctl -u gunicorn -n 100 --no-pager
sudo journalctl -u gunicorn -f # follow in real time
sudo journalctl -u gunicorn --since "2026-06-08" --no-pager
# All services since reboot
sudo journalctl -b --no-pager | grep -E "gunicorn|celery|nginx" | head -50
Logs don't auto-rotate by default. Set up logrotate to prevent disk filling:
sudo nano /etc/logrotate.d/yealinbilling
/var/www/yealinbilling/logs/*.log {
daily
rotate 30
compress
delaycompress
missingok
notifempty
sharedscripts
postrotate
systemctl reload gunicorn celery celerybeat > /dev/null 2>&1 || true
endscript
}
# Check overall disk usage
df -h /
# Check log directory size
du -sh /var/www/yealinbilling/logs/
# Check media directory (PDF invoices)
du -sh /var/www/yealinbilling/media/
# Find largest files
find /var/www/yealinbilling -name "*.log" -exec du -sh {} \; | sort -rh | head -10
# Clear a log file (keeps file, empties it)
> /var/www/yealinbilling/logs/gunicorn-access.log
# View Wiki.js logs
cd /opt/wikijs
docker compose logs -f wikijs
# Last 100 lines
docker compose logs --tail=100 wikijs
# Database logs
docker compose logs --tail=50 wikijs-db
# Most recent Django errors
tail -50 /var/www/yealinbilling/logs/django-errors.log
# 502 errors in Nginx (Gunicorn socket issues)
grep "502" /var/log/nginx/error.log | tail -20
# Permission denied (socket permission issues)
grep "Permission denied" /var/log/nginx/error.log | tail -10
# Email delivery in Exim (run on aum.bylaw.com.au)
grep "billing@yealin.com.au" /var/log/exim_mainlog | tail -20