The error_log directive controls error and debug logging in nginx. Setting its level to debug enables detailed debug logs. The access_log directive does not accept a debug level. There is no log_level or debug_log directive in nginx.
nginx -V
The nginx -V command shows build options. The presence of --with-debug means nginx was compiled with debug support. The other options are not part of the nginx -V output.
Setting error_log with debug level inside the location /api block enables debug logging only for that location. The access_log directive does not support debug level. The other options either set logging globally or use invalid directives.
error_log /var/log/nginx/error.log debug; but no debug messages appear in the log. What is the most likely cause?If nginx was not compiled with --with-debug, debug logging directives are ignored. The error_log directive can be in main or http blocks. Incorrect log path causes errors but usually logs warnings. There is no --debug flag for nginx start.
Enabling debug logging only for the affected location reduces performance impact. Reloading configuration applies changes without downtime. Global debug logging or permanent debug mode can degrade performance. Stopping nginx is unnecessary and causes downtime.