Ravindra BagaleCourses & study guides

Chapter 14: Logging and Light Observability

14.3 Local OS logs — journald and files

On systemd hosts (Amazon Linux, Ubuntu):

journalctl -u nginx -n 50 --no-pager
journalctl -u your-app.service -f

Some apps still write files under /var/log/.... Know where your app writes. For Linux depth, refresh the AWS Cloud Linux chapters.

logrotate (idea): periodically compress/rename old log files so disks do not fill. Without rotation, yesterday's monitoring disk alert becomes today's outage.

# Conceptual rotate policy ideas (exact config varies by distro)
- rotate weekly or when size exceeds a limit
- keep N compressed archives
- signal the app to reopen files if needed

Ravindra Bagale's Tip

Disk full = often logs without rotate athava leftover docker layers. Monitoring (ch13) + logging hygiene = ekach story. Lakshat theva!