0
0
Nginxdevops~20 mins

Error log configuration in Nginx - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Error Log Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
💻 Command Output
intermediate
2:00remaining
What is the effect of this nginx error_log directive?
Given the nginx configuration line:
error_log /var/log/nginx/error.log warn;

What is the effect of this directive?
Nginx
error_log /var/log/nginx/error.log warn;
ALogs only error messages to /var/log/nginx/error.log
BLogs messages with severity warn and higher to /var/log/nginx/error.log
CDisables error logging
DLogs all messages including debug to /var/log/nginx/error.log
Attempts:
2 left
💡 Hint
Severity levels in nginx error_log go from debug, info, notice, warn, error, crit, alert, emerg.
Configuration
intermediate
2:00remaining
Choose the correct nginx error_log directive to log only critical errors
Which of the following nginx error_log directives will log only critical errors and above (crit, alert, emerg) to /var/log/nginx/critical.log?
Aerror_log /var/log/nginx/critical.log info;
Berror_log /var/log/nginx/critical.log error;
Cerror_log /var/log/nginx/critical.log warn;
Derror_log /var/log/nginx/critical.log crit;
Attempts:
2 left
💡 Hint
Higher severity levels include crit, alert, emerg. Lower levels include error, warn, info.
Troubleshoot
advanced
2:00remaining
Why does nginx not log debug messages despite error_log set to debug?
You set this directive:
error_log /var/log/nginx/debug.log debug;

But no debug messages appear in the log. What is the most likely reason?
AThe debug log file path is incorrect
BThe error_log directive must be inside the http block to work
CNginx was not compiled with debug support enabled
DDebug messages are only logged if the server is restarted twice
Attempts:
2 left
💡 Hint
Debug logging requires special compile-time support in nginx.
Best Practice
advanced
2:00remaining
What is the recommended way to separate error logs by server block in nginx?
You want to keep error logs separate for each server block in nginx. Which configuration is best practice?
ASet error_log inside each server block with a unique file path
BSet one global error_log in the main context for all servers
CDisable error_log and rely on access_log for errors
DUse syslog for all error logs instead of files
Attempts:
2 left
💡 Hint
Error logs can be set at different levels in nginx config hierarchy.
🔀 Workflow
expert
3:00remaining
Order the steps to enable and verify nginx error logging at 'error' level
Put these steps in the correct order to enable error logging at 'error' level and verify it works:
A1,2,3,4
B2,1,3,4
C1,3,2,4
D3,1,2,4
Attempts:
2 left
💡 Hint
Configuration changes require reload before testing.