Which logging trap command configures syslog to record both warnings and errors?
Choose an answer
Tap an option to check your answer.
Correct answer: logging trap 4.
Why this is the answer
The logging trap command sets the minimum severity level for messages that syslog sends to a logging server. Severity levels range from 0 (emergencies) to 7 (debugging). Level 4 corresponds to "warnings." When you set logging trap 4, syslog will send messages with severity levels 0 through 4 (emergencies, alerts, critical, errors, and warnings) to the logging server. This fulfills the requirement to record both warnings and errors, as errors are at level 3 and warnings at level 4. logging trap 5 would only send notifications (level 5) and more severe messages (0-4), which is too broad. logging trap 2 would send critical (level 2) and more severe messages (0-1), omitting errors and warnings. logging trap 3 would send errors (level 3) and more severe messages (0-2), omitting warnings.
Pass your exam — without the endless answer hunt
Get every verified question and explanation for this exam in one place, and save hours of prep. 1,000+ certifications · 20+ languages · free to start.
Pass your exam faster → No card needed