How to view system logs with journalctl
· Category: Linux
Short answer
journalctl queries the systemd journal, offering powerful filtering by unit, time, priority, and boot.
Steps
- View all logs:
journalctl
- Logs for a specific service:
journalctl -u nginx
- Follow real-time logs:
journalctl -f
- Logs since last boot:
journalctl -b
- Time range:
journalctl --since "2025-10-01" --until "2025-10-20"
Tips
journalctl --disk-usageshows journal size.journalctl -p errfilters by priority.- Persistent logging requires creating
/var/log/journal.
Common issues
- Empty output: the journal may be volatile or the service uses a different logger.
- Very large journals: configure rotation with
journald.conf.