Challenge - 5 Problems
Error Log Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
💻 Command Output
intermediate2:00remaining
What is the effect of this nginx error_log directive?
Given the nginx configuration line:
What is the effect of this directive?
error_log /var/log/nginx/error.log warn;
What is the effect of this directive?
Nginx
error_log /var/log/nginx/error.log warn;
Attempts:
2 left
💡 Hint
Severity levels in nginx error_log go from debug, info, notice, warn, error, crit, alert, emerg.
✗ Incorrect
The 'warn' level means log messages with severity warn, error, crit, alert, emerg will be logged. Lower levels like info or debug are ignored.
❓ Configuration
intermediate2: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?
Attempts:
2 left
💡 Hint
Higher severity levels include crit, alert, emerg. Lower levels include error, warn, info.
✗ Incorrect
Setting level to 'crit' logs only critical and more severe messages. 'error' or 'warn' would log more messages than requested.
❓ Troubleshoot
advanced2:00remaining
Why does nginx not log debug messages despite error_log set to debug?
You set this directive:
But no debug messages appear in the log. What is the most likely reason?
error_log /var/log/nginx/debug.log debug;
But no debug messages appear in the log. What is the most likely reason?
Attempts:
2 left
💡 Hint
Debug logging requires special compile-time support in nginx.
✗ Incorrect
Nginx must be compiled with the --with-debug option to enable debug logging. Without it, debug messages are ignored even if configured.
✅ Best Practice
advanced2: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?
Attempts:
2 left
💡 Hint
Error logs can be set at different levels in nginx config hierarchy.
✗ Incorrect
Setting error_log inside each server block allows logs to be separated by server. Global error_log applies to all servers if not overridden.
🔀 Workflow
expert3: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:
Attempts:
2 left
💡 Hint
Configuration changes require reload before testing.
✗ Incorrect
First configure error_log, then reload nginx to apply changes, then generate an error, finally check the log file.