Tools for Regular Operations
132
In
addition to journalctl, there are additional logs that we can look at when we wish to check the system’s health. Let’s look at an example with /var/log/messages:
Figure 4.14 – Excerpt of /var/log/messages
In this example, we can see how the system ran some commands while following a similar output to the initial lines. For example, in the preceding example, we can see how sysstat has been executed every 10 minutes, as well as how the dnf cache has been updated.
Let’s look at a list of important logs that are available in a standard system installation (note that the filenames are relative to the /var/log folder boot.log: Stores the messages that are emitted by the system during boot. It might contain escape codes that are used to provide colorized output audit/audit.log: Contains the stored messages that have been generated by the kernel audit subsystem secure Contains security-related messages, such as failed sshd login attempts dnf.log:
Logs generated by the Dandified YUM (
DNF) package manager, such as cache refreshes firewalld: Output generated by the firewalld daemon.
Finding logs, using journald, and reading log files, including log preservation and rotation lastlog: This is a binary file that contains information about the last few users logging into the system (to be queried via the last command messages The default logging facility. This means that anything that is not a specific log will go here. Usually, this is the best place to start checking what happened with a system maillog: The log for the mail subsystem.
When enabled, it attempts to deliver messages. Any messages that are received will be stored here. It’s common practice to configure outgoing mail from servers so that system alerts or script outputs can be delivered btmp: Binary log for failed access to the system wtmp: Binary log for access to the system sa/sar*: Text logs for the sysstat utility (the binary ones, named sa, plus the day number, are converted via a cron job at night).
Additional log files might exist, depending on the services
that have been installed, the installation method that was used, and soon. It is very important to get used to the available logs and—of course—
review their contents to see how the messages are formatted, how many logs are created everyday, and what kind of information they produce.
Using the information that’s been logged, we will get hints on how to configure each individual daemon. This allows us to adjust the log level between showing just errors or being more verbose about debugging issues. This means we can configure the required log rotation to avoid risking system stability because all the space has been consumed by logs.
Share with your friends: