Recall & Review
beginner
What is the purpose of the
error_log directive in nginx?The
error_log directive tells nginx where to save error messages and what level of errors to record. It helps track problems in the server.Click to reveal answer
beginner
How do you set the error log file path and error level in nginx?
Use
error_log /path/to/logfile level; inside the nginx configuration. For example, error_log /var/log/nginx/error.log warn; saves warnings and above to that file.Click to reveal answer
intermediate
Name four common error log levels in nginx.
The common levels are
debug, info, notice, warn, error, and crit. They control how detailed the logs are.Click to reveal answer
intermediate
Where can the
error_log directive be placed in nginx configuration?It can be placed in the
main context (top level), http, server, or location blocks. More specific blocks override higher-level settings.Click to reveal answer
advanced
What happens if you set the error log level to
debug?nginx logs very detailed information about its operations, which helps in deep troubleshooting but can create large log files and slow performance.
Click to reveal answer
Which directive sets the error log file in nginx?
✗ Incorrect
The
error_log directive configures where nginx writes error messages.What is the default error log level if none is specified?
✗ Incorrect
If no level is set, nginx uses
error level by default.Where can you NOT place the
error_log directive?✗ Incorrect
The
error_log directive cannot be placed inside if statements.Which error log level records the least amount of information?
✗ Incorrect
crit logs only critical errors, so it records the least information.What is a risk of setting error log level to
debug in production?✗ Incorrect
Debug level creates very detailed logs, which can slow the server and fill disk space quickly.
Explain how to configure error logging in nginx including setting the log file and log level.
Think about the directive format and where it goes in the config.
You got /4 concepts.
Describe the impact of different error log levels on nginx logging and server performance.
Consider what happens when you log more or less information.
You got /4 concepts.