Linux troubleshooting with journald

systemd is a service and system manager for Linux that contains the command line tool journalctl and the journald daemon that aims to make life easier for anyone troubleshooting syslog messages in a Linux system.

The journald daemon collects syslog messages and forwards them to the rsyslog service which sorts the syslog messages and writes them to files in the /var/log directory for persistent storage. Without journald, you would have to sort and grep through the various log files.

By default, journald keeps a nonpersistent database of the collected logs in /run/log/journal that can be represented to the user with the journalctl command. You can make journald persistent upon reboot by altering the storage option in the /etc/systemd/journald.conf file.

The following command displays logs in the reverse order with extra information (if available) for priority 4 (warning) or higher.

$ journalctl -rx -p 4

journalctl uses less to display the log messages which means you exit with q , move to the last line with G and the first line with gg etc.

Take a look at $ man journalctl for all available options.


Posted

in

by

Comments

Leave a Reply

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