Red Hat Training
A Red Hat training course is available for RHEL 8
Chapter 9. Troubleshooting problems using log files
Log files contain messages about the system, including the kernel, services, and applications running on it. These contain information that helps troubleshoot issues or monitor system functions. The logging system in Red Hat Enterprise Linux is based on the built-in syslog
protocol. Particular programs use this system to record events and organize them into log files, which are useful when auditing the operating system and troubleshooting various problems.
9.1. Services handling syslog messages
The following two services handle syslog
messages:
-
The
systemd-journald
daemon -
The
Rsyslog
service
The systemd-journald
daemon collects messages from various sources and forwards them to Rsyslog
for further processing. The systemd-journald
daemon collects messages from the following sources:
- Kernel
- Early stages of the boot process
- Standard and error output of daemons as they start up and run
-
Syslog
The Rsyslog
service sorts the syslog
messages by type and priority and writes them to the files in the /var/log
directory. The /var/log
directory persistently stores the log messages.
9.2. Subdirectories storing syslog messages
The following subdirectories under the /var/log
directory store syslog
messages.
-
/var/log/messages
- allsyslog
messages except the following -
/var/log/secure
- security and authentication-related messages and errors -
/var/log/maillog
- mail server-related messages and errors -
/var/log/cron
- log files related to periodically executed tasks -
/var/log/boot.log
- log files related to system startup
9.3. Inspecting log files using the web console
Follow the steps in this procedure to inspect the log files using the RHEL web console.
Procedure
- Log into the RHEL web console. For details see Logging in to the web console.
- Click Logs.
Figure 9.1. Inspecting the log files in the RHEL 8 web console

9.4. Viewing logs using the command line
The Journal is a component of systemd that helps to view and manage log files. It addresses problems connected with traditional logging, closely integrated with the rest of the system, and supports various logging technologies and access management for the log files.
You can use the journalctl
command to view messages in the system journal using the command line, for example:
$ journalctl -b | grep kvm
May 15 11:31:41 localhost.localdomain kernel: kvm-clock: Using msrs 4b564d01 and 4b564d00
May 15 11:31:41 localhost.localdomain kernel: kvm-clock: cpu 0, msr 76401001, primary cpu clock
...
Table 9.1. Viewing system information
Command | Description |
---|---|
| Shows all collected journal entries. |
|
Shows logs related to a specific file. For example, the |
| Shows logs for the current boot. |
| Shows kernel logs for the current boot. |
Table 9.2. Viewing information about specific services
Command | Description |
---|---|
|
Filters log to show entries matching the |
|
Combines matches. For example, this command shows logs for |
|
The plus sign (+) separator combines two expressions in a logical OR. For example, this command shows all messages from the |
|
This command shows all entries matching either expression, referring to the same field. Here, this command shows logs matching a systemd-unit |
Table 9.3. Viewing logs related to specific boots
Command | Description |
---|---|
| Shows a tabular list of boot numbers, their IDs, and the timestamps of the first and last message pertaining to the boot. You can use the ID in the next command to view detailed information. |
| Shows information about the specified boot ID. |
9.5. Additional resources
-
man journalctl(1)
- Configuring a remote logging solution