view xml/en/docs/debugging_log.xml @ 271:4c6d2c614d2c

Cleaned up XML tag mess: - all of <parameter> and <code>, and some of <dirname>, <value>, and <command> were replaced by <literal>; - the rest of <dirname> were replaced by links; - <argument> were replaced by <value>; - <value> is now rendered in HTML in italic; - <literal> and <path> can now contain <value>. Cleaned up terminology mess: - directives take "parameters".
author Ruslan Ermilov <ru@nginx.com>
date Fri, 23 Dec 2011 17:29:59 +0000
parents 5284967934df
children 8e1356bd281a
line wrap: on
line source

<!DOCTYPE article SYSTEM "../../../dtd/article.dtd">

<article name="A debugging log"
         link="/en/docs/debugging_log.html"
         lang="en">


<section>

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

<programlisting>
./configure --with-debug ...
</programlisting>

Then the <literal>debug</literal> level should be set with the
<link doc="ngx_core_module.xml" id="error_log"/> directive:

<programlisting>
error_log /path/to/log debug;
</programlisting>

The nginx binary version for Windows is always built with the debugging log
support, so only setting the <literal>debug</literal> level will suffice.
</para>

<para>
Note that redefining the log without also specifying the
<literal>debug</literal>
level will disable the debugging log.
In the example below, redefining the log on the
<link doc="http/ngx_http_core_module.xml" id="server"/>
level disables the debugging log for this server:
<programlisting>
error_log /path/to/log debug;

http {
    server {
        error_log /path/to/log;
        ...
</programlisting>
To avoid this, either the line redefining the log should be
commented out, or the <literal>debug</literal> level specification should
also be added:
<programlisting>
error_log /path/to/log debug;

http {
    server {
        error_log /path/to/log debug;
        ...
</programlisting>
</para>

<para>
It is also possible to enable the debugging log for selected addresses only:

<programlisting>
error_log /path/to/log;

events {
    debug_connection 192.168.1.1;
    debug_connection 192.168.10.0/24;
}
</programlisting>
</para>

</section>

</article>