0
0
Nginxdevops~5 mins

Error log configuration in Nginx - Cheat Sheet & Quick Revision

Choose your learning style9 modes available
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?
Alog_format
Baccess_log
Cerror_log
Dserver_log
What is the default error log level if none is specified?
Aerror
Binfo
Cwarn
Ddebug
Where can you NOT place the error_log directive?
Aserver block
Binside a <code>if</code> statement
Clocation block
Dhttp block
Which error log level records the least amount of information?
Acrit
Bwarn
Cinfo
Ddebug
What is a risk of setting error log level to debug in production?
ALogs may miss errors
BNo logs are created
CLogs become too small
DPerformance may slow and logs grow large
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.