A debugging log

A debugging log

To enable a debugging log, nginx needs to be configured to support debugging during the build:

./configure --with-debug ...

Then the debug level should be set with the error_log directive:

error_log /path/to/log debug;

To verify that nginx is configured to support debugging, run the nginx -V command:

configure arguments: --with-debug ...

Pre-built Linux packages provide out-of-the-box support for debugging log with the nginx-debug binary (1.9.8) which can be run using commands

service nginx stop
service nginx-debug start

and then set the debug level. The nginx binary version for Windows is always built with the debugging log support, so only setting the debug level will suffice.

Note that redefining the log without also specifying the debug level will disable the debugging log. In the example below, redefining the log on the server level disables the debugging log for this server:

error_log /path/to/log debug;

http {
    server {
        error_log /path/to/log;
        ...

To avoid this, either the line redefining the log should be commented out, or the debug level specification should also be added:

error_log /path/to/log debug;

http {
    server {
        error_log /path/to/log debug;
        ...
doc_nginx
2017-02-09 07:05:24
Comments
Leave a Comment

Please login to continue.