How to read and manage logs in Linux
Updated 7/20/2026
When something goes wrong, the answer is almost always in the logs. Here is how to find and read them.
Service logs (systemd)
journalctl -u nginx # a service's logs
journalctl -u nginx -f # live
journalctl -u nginx --since "1 hour ago"
Classic log files
/var/log/syslog # the system
/var/log/auth.log # authentication (SSH)
/var/log/nginx/ # nginx
Search efficiently
grep "error" /var/log/nginx/error.log
tail -f /var/log/nginx/access.log
Kernel logs
dmesg | tail
Tips
- Check
auth.logfor suspicious login attempts, then harden with fail2ban. - Logs take up space; configure rotation, see log rotation.
- For multiple servers, use centralized logging.
Put this guide into practice on your own VPS
EU cloud servers, billed hourly, ready in minutes, with one-click installs for dozens of apps.
See pricingRelated tutorials
Monitoring & logging
How to monitor database performance
See slow queries, connections and database usage, to keep it fast.
Updated 7/20/2026Monitoring & loggingHow to monitor disk space and avoid running out
A full disk stops services and corrupts data. Here is how to track space and get alerts in time.
Updated 7/20/2026Monitoring & loggingHow to monitor a website and SSL expiry
Do not let your site go down or your SSL certificate expire without knowing. Here is how to track them automatically.
Updated 7/20/2026