Send a shell message with facility local0 and priority notice.
Which command is appropriate?
logger -p FACILITY.PRIORITY MESSAGE sends a message with the selected classification.
Detailed explanation
logger -t local0.notice 'job completed'Incorrect. -t specifies a tag, not facility and priority.
Incorrect. -t specifies a tag, not facility and priority.
logger -f local0.notice 'job completed'Incorrect. -f reads messages from a file.
Incorrect. -f reads messages from a file.
logger -p local0.notice 'job completed'Correct. -p local0.notice sets the requested classification.
Correct. -p local0.notice sets the requested classification.
logger -u local0.notice 'job completed'Incorrect. -u selects a socket.
Incorrect. -u selects a socket.
Try it yourself
An example you can run in a temporary verification environment.
logger --help 2>&1 | grep -E -- '--priority| -p' | head -n 1Expected result
-pまたは--priorityのhelp行Key points
- -p selects priority
- local0.notice
- -t is tag
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.