0
0
Nginxdevops~10 mins

Error log configuration in Nginx - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to set the error log file path in nginx configuration.

Nginx
error_log [1];
Drag options to blanks, or click blank then click option'
A/var/log/nginx/error.log
B/etc/nginx/nginx.conf
C/usr/share/nginx/html
D/tmp/access.log
Attempts:
3 left
💡 Hint
Common Mistakes
Using the main configuration file path instead of the log file path.
Using the access log file path instead of the error log file path.
2fill in blank
medium

Complete the code to set the error log level to 'warn' in nginx configuration.

Nginx
error_log /var/log/nginx/error.log [1];
Drag options to blanks, or click blank then click option'
Awarn
Berror
Cdebug
Dinfo
Attempts:
3 left
💡 Hint
Common Mistakes
Using info or debug when warn is required.
Omitting the log level, which defaults to error.
3fill in blank
hard

Fix the error in the code to correctly set the error log path and level.

Nginx
error_log /var/log/nginx/error.log [1];
Drag options to blanks, or click blank then click option'
Awarning
Bwarn
Cwarnning
Dwarns
Attempts:
3 left
💡 Hint
Common Mistakes
Misspelling warn as warning or warnning.
Adding extra letters like warns.
4fill in blank
hard

Fill both blanks to configure error log path and log level correctly.

Nginx
error_log [1] [2];
Drag options to blanks, or click blank then click option'
A/var/log/nginx/custom_error.log
Bwarn
Cinfo
D/var/log/nginx/access.log
Attempts:
3 left
💡 Hint
Common Mistakes
Using access log path instead of error log path.
Using incorrect log levels like info when warn is expected.
5fill in blank
hard

Fill all three blanks to configure error log path, log level, and disable logging to stderr.

Nginx
error_log [1] [2] [3];
Drag options to blanks, or click blank then click option'
A/var/log/nginx/error.log
Berror
Coff
Dwarn
Attempts:
3 left
💡 Hint
Common Mistakes
Using error instead of warn for the log level.
Not disabling stderr logging when required.