CompTIA Linux+ (XK0-004) — Question 185
A Linux administrator wants to configure log messages of critical or higher severity levels from the cron utility to be logged to the console. Which of the following will accomplish this objective?
Answer options
- A. Edit the /etc/logrotate.d/cron file to include the line cron.emerg.* /dev/console
- B. Edit the /etc/rsyslog.conf file to include the line cron.emerg.* /dev/console
- C. Edit the /etc/logrotate.conf file to include the line cron.emerg.* /dev/console
- D. Edit the /etc/rsyslog.d/conf file to include the line cron.emerg.* /dev/console
Correct answer: B
Explanation
The correct answer is B because the /etc/rsyslog.conf file is the configuration file for rsyslog, which is responsible for logging messages, including those from cron. The other options involve log rotation settings that do not control where log messages are sent, making them incorrect for this requirement.