nerdexam
CompTIA

XK0-005 · Question #158

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?

The correct answer is B. Edit the /etc/rsyslog.conf file to include the line cron.emerg.* /dev/console. The administrator aims to configure the system to send critical or higher severity log messages from the cron utility to the console.

System Management

Question

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?

Options

  • AEdit the /etc/logrotate.d/cron file to include the line cron.emerg.* /dev/console
  • BEdit the /etc/rsyslog.conf file to include the line cron.emerg.* /dev/console
  • CEdit the /etc/logrotate.conf file to include the line cron.emerg.* /dev/console
  • DEdit the /etc/rsyslog.d/conf file to include the line cron.emerg.* /dev/console

How the community answered

(24 responses)
  • B
    92% (22)
  • C
    4% (1)
  • D
    4% (1)

Why each option

The administrator aims to configure the system to send critical or higher severity log messages from the cron utility to the console.

AEdit the /etc/logrotate.d/cron file to include the line cron.emerg.* /dev/console

Files in `/etc/logrotate.d/` are used by `logrotate` to manage the archiving and deletion of log files, not to configure real-time message routing to the console.

BEdit the /etc/rsyslog.conf file to include the line cron.emerg.* /dev/consoleCorrect

Syslog (specifically `rsyslog` on modern Linux systems) manages log message routing based on facility and severity. Editing `/etc/rsyslog.conf` and adding `cron.emerg.* /dev/console` creates a rule that directs all log messages from the `cron` facility with severity 'emerg' or higher to the system console.

CEdit the /etc/logrotate.conf file to include the line cron.emerg.* /dev/console

The `/etc/logrotate.conf` file is the main configuration file for `logrotate`, defining global log rotation policies, and is not used for real-time log message forwarding.

DEdit the /etc/rsyslog.d/conf file to include the line cron.emerg.* /dev/console

While rsyslog can use files in `/etc/rsyslog.d/`, the specific file name `conf` is not standard, and `/etc/rsyslog.conf` is the primary and most common location for such global configuration directives.

Concept tested: Syslog configuration for routing messages by facility and severity

Source: https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/7/html/system_administrators_guide/ch-configuring_system_logging

Topics

#Logging#rsyslog#System Configuration#Log Management

Community Discussion

No community discussion yet for this question.

Full XK0-005 Practice