How to check last boot’s systemd journal log in CentOS 7 Linux?

The command to check last boot’s journal log shows nothing on CentOS 7:

# journalctl -b -1

Failed to look up boot -1: No such boot ID in journal

Is the log stored and where it is?

The reason this happens on CentOS 7 is that CentOS 7 by default does not enable the persistent storage of log messages. You can enable it and configure journald to store the log files into `/var/log/journal` by

# mkdir /var/log/journal
# systemd-tmpfiles --create --prefix /var/log/journal
# systemctl restart systemd-journald
Leave a Reply

Your email address will not be published. Required fields are marked *