Debug logs not getting generated

Hello,
I followed this A debugging log. Have nginx
built with --with-debug and set the the error_log in the following 2
files
(nginx.conf.main & inside http { } in nginx.conf.web). But still i don’t
see debug level logging getting generated in the files specified.

error_log /log/nginx.log debug;

Tried with the rewrite_flag on too. Am i missing something ?

Also does anyone know why does nginx has these 2 types of template files
?(i.e .template & .default.template)
for eg. nginx.conf.web.http.template &
nginx.conf.web.http.default.template
I see them to be exactly same.

Thanks
-Kunal

Hello!

On Fri, Mar 28, 2014 at 06:04:04PM -0700, Kunal P. wrote:

Hello,
I followed this A debugging log. Have nginx
built with --with-debug and set the the error_log in the following 2 files
(nginx.conf.main & inside http { } in nginx.conf.web). But still i don’t
see debug level logging getting generated in the files specified.

error_log /log/nginx.log debug;

Tried with the rewrite_flag on too. Am i missing something ?

Yes. Some things to check, in no particular order:

  1. Is nginx installed is actually compiled with --with-debug
    (check the “nginx -V” output)?

  2. Are you running nginx binary you are checking? Make sure the
    binary you are running isn’t some other binary, e.g., run from a
    different directory.

  3. Make sure you’ve restarted nginx (or upgraded running binary).

  4. Make sure the config you are editing is right one (and again,
    you’ve reloaded a configuration after editing it; note that you
    have to check logs after a configuration reload to make sure it
    was successful).

Also does anyone know why does nginx has these 2 types of template files
?(i.e .template & .default.template)
for eg. nginx.conf.web.http.template & nginx.conf.web.http.default.template
I see them to be exactly same.

There are no such files in nginx itself. Likely it’s something
provided by your OS package.


Maxim D.
http://nginx.org/

  1. Make sure you’ve restarted nginx (or upgraded running binary).

  2. Make sure the config you are editing is right one (and again,
    you’ve reloaded a configuration after editing it; note that you
    have to check logs after a configuration reload to make sure it
    was successful).

I noticed that the config file (conf/nginx/nginx.conf.main) i am
changing
loses the changes after restarting nginx. Not sure why this should
happen
as config files need to be persistent across reloads.

Never mind. Got it working. Had a script which was overwriting the
loglevel
value in the conf file after restarting nginx.
Thanks for the help.