Send one message, maintenance-start, from a shell to syslog.
Which command is appropriate?
logger sends a message from a shell or script through the syslog interface.
Detailed explanation
logger maintenance-startCorrect. logger sends the supplied text to syslog.
Correct. logger sends the supplied text to syslog.
journalctl maintenance-startIncorrect. journalctl queries the journal and does not create a message.
Incorrect. journalctl queries the journal and does not create a message.
logrotate maintenance-startIncorrect. logrotate manages log files.
Incorrect. logrotate manages log files.
rsyslogd maintenance-startIncorrect. rsyslogd is the processing daemon, not this one-message command.
Incorrect. rsyslogd is the processing daemon, not this one-message command.
Try it yourself
An example you can run in a temporary verification environment.
logger --help | sed -n '1,10p'Expected result
loggerの使用方法Key points
- logger is the sending client
- journalctl reads logs
- Facility and priority can be selected
Notes
- Environment: util-linux logger help / ログ送信なし
- Command output formatting can vary slightly by distribution or tool version.
- Run the example in a temporary directory or process when possible.
Foundation review
Read the scope first
Check whether the command acts on the current shell, a new process, an existing process, or a file.
Verify the observable result
Use the supplied command and compare the output with the expected result.