Mercurial > hg > nginx-site
diff xml/en/docs/stream/ngx_stream_log_module.xml @ 2540:b686736680e3
Documented escaping rules in log_format.
author | Yaroslav Zhuravlev <yar@nginx.com> |
---|---|
date | Tue, 12 May 2020 22:06:12 +0100 |
parents | dab82d534f0f |
children | eeed494bba51 |
line wrap: on
line diff
--- a/xml/en/docs/stream/ngx_stream_log_module.xml Wed Apr 29 11:29:05 2020 +0300 +++ b/xml/en/docs/stream/ngx_stream_log_module.xml Tue May 12 22:06:12 2020 +0100 @@ -9,7 +9,7 @@ <module name="Module ngx_stream_log_module" link="/en/docs/stream/ngx_stream_log_module.html" lang="en" - rev="6"> + rev="7"> <section id="summary"> @@ -177,6 +177,32 @@ The <literal>none</literal> parameter (1.13.10) disables escaping. </para> +<para id="log_format_escape_default"> +For <literal>default</literal> escaping, +characters “<literal>"</literal>”, “<literal>\</literal>”, +and other characters with values less than 32 or above 126 +are escaped as “<literal>\xXX</literal>”. +If the variable value is not found, +a hyphen (“<literal>-</literal>”) will be logged. +</para> + +<para id="log_format_escape_json"> +For <literal>json</literal> escaping, +all characters not allowed +in JSON <link url="https://tools.ietf.org/html/rfc8259#section-7">strings</link> +will be escaped: +characters “<literal>"</literal>” and +“<literal>\</literal>” are escaped as +“<literal>\"</literal>” and “<literal>\\</literal>”, +characters with values less than 32 are escaped as +“<literal>\n</literal>”, +“<literal>\r</literal>”, +“<literal>\t</literal>”, +“<literal>\b</literal>”, +“<literal>\f</literal>”, or +“<literal>\u00XX</literal>”. +</para> + </directive>