Hello and welcome to this video on Oracle Linux 8.
In this video, I will cover Oracle Linux 8's rsyslog logging utility.
For our objectives today and after viewing this video, you should be able to:
Describe the rsyslog logging utility.
Explain the different components of the rsyslog configuration file.
Describe how to configure rsyslog for logging and changing an action.
And finally, you should be able to explain how to add and remove a cron job.
Log files contain messages about the system, the kernel, services, and applications.
Most of these log files are located in the /var/log/ directory.
Some log files are controlled by the rsyslogd daemon.
The main configuration file for rsyslogd is /etc/rsyslog.conf,
which contains global directives, modules, and rules.
Global directives are configuration options that apply to the rsyslogd daemon
Modules are dynamically loaded modules that provide additional functionality and associated
configuration directives. Rules define a filter, which is a subset
of rsyslog messages, and an action, which specifies what to do with the messages.
Let's explore the main configuration file for system logging, /etc/rsyslog.conf
As root, use the less command to view the system logging configuration file
Use the up-arrow and down-arrow keys to view the various sections of the file.
The MODULES section uses the $ModLoad command to load the modules.
The GLOBAL DIRECTIVES section specifies configuration options.
The RULES section defines a selector (facility.priority) and an action.
Press the q key to exit the less command. Now let's change the action for cron logging.
Use the ls command to list the cron* files in the /var/log directory.
Next, use the vi editor to modify the system logging configuration file.
Change the action for cron logging to log in to a different log file: /var/log/cron_new.
Now use the systemctl command to restart the rsyslog service.
Use the crontab –e command to create a cron job that runs the ls command every minute.
Next use the ls command to list the cron* files in the /var/log directory.
With the tail command, view the last two lines in the cron log file.
Use the head command to view the first entries in the cron_new log file.
Note the date_time stamps that the new log entries are being written to cron_new.
Next use the vi editor to modify the system logging configuration file.
Change the action for cron logging back in to the original log file.
Use the systemctl command to restart the rsyslog service.
Now use the tail command to ensure that cron is now logging in to /var/log/cron
Note that the entry in cron has a later time stamp than the entry in cron_new.
You may need to wait a minute for the cron job to run.
Next use the rm command to delete the cron_new log file.
And then, use crontab –r to remove the crontab. After watching this video,
you should now be able to: Describe the rsyslog logging utility
Explain the different components of the rsyslog configuration file.
Describe how to configure rsyslog for logging and changing an action.
And finally, you should now be able to explain how to how to add and remove a cron job.
Oracle provides an extensive number of resources
which you can use to learn more about this subject and others.
Look for additional videos on Oracle Linux 8 ond other topics using the links shown.
This concludes the video. Thank you for watching.