102-500 · Question #147
Which of the following commands is used on the command line to send messages to the syslog systems?
The correct answer is C. logger. logger is the standard Unix/Linux command-line utility that allows users and scripts to submit messages directly to the system log (syslog), making it ideal for shell scripts that need to write to /var/log/syslog or similar log files. Why the distractors are wrong: A. lastlog…
Question
Options
- Alastlog
- Bklog
- Clogger
- Dslog
- Esyslog
How the community answered
(37 responses)- B3% (1)
- C84% (31)
- D8% (3)
- E5% (2)
Explanation
logger is the standard Unix/Linux command-line utility that allows users and scripts to submit messages directly to the system log (syslog), making it ideal for shell scripts that need to write to /var/log/syslog or similar log files.
Why the distractors are wrong:
- A. lastlog - displays the most recent login information for all users; it reads login records, not syslog.
- B. klog - relates to the kernel logging daemon (not a user-facing command for sending messages); it reads kernel messages from
/proc/kmsg. - D. slog - not a standard Linux command; this is a fictional distractor.
- E. syslog -
syslogis the protocol/facility (and a C library function), not a command-line tool you invoke directly.
Memory tip: Think of logger as "I want to log a message right now" - it's the action word. The others are either daemons, readers, or made-up names. A quick example: logger "Backup completed successfully" writes that string directly to syslog.
Topics
Community Discussion
No community discussion yet for this question.