An administrator needs to look at a log for an application on a systemd-based system.
There is no log for this application in /var/log.
Which of the following is another way to view the application log on this system?
Click on the arrows to vote for the correct answer
A. B. C. D.C.
The correct answer is B. journalctl "u application".
Explanation:
Systemd is a system and service manager for Linux operating systems. It is responsible for controlling the system startup process and managing system processes after booting.
In a systemd-based system, journalctl is the command-line utility used to access the systemd journal, which stores information about system and service events.
To view the log for an application on a systemd-based system, the administrator should use the journalctl command with the "u" option, which stands for "unit" and specifies the unit file associated with the application. The syntax for the command is as follows:
journalctl -u application.service
This will display the log messages for the specified application. The ".service" extension is required when specifying the unit file name.
Option A, tail -f /var/log/secure, is not relevant to the application log since it only displays the log messages from the /var/log/secure file, which contains system authentication messages.
Option C, systemctl application.service, is a command to manage the systemd service associated with the application. It will start, stop, or check the status of the service, but it will not display the application log.
Option D, watch /var/lib/application/, is also not relevant to the application log. It will display the contents of the /var/lib/application/ directory, which may contain files used by the application, but not necessarily the log file.