[PATCH] Escape strings produced by the `%V` format specification

Maxim Dounin mdounin at mdounin.ru
Thu Jan 5 00:18:36 UTC 2017


On Tue, Jan 03, 2017 at 05:24:59PM +1100, josh at joshuaspence.com wrote:

> # HG changeset patch
> # User Joshua Spence <josh at joshuaspence.com>
> # Date 1483420178 -39600
> #      Tue Jan 03 16:09:38 2017 +1100
> # Node ID 8e734d01f026c4346b46006ee9b558031439be61
> # Parent  a42afc225e98afe1f7c3b428c81c8af7eba362c0
> Escape strings produced by the `%V` format specification
> Currently nginx error logs loosely adhere to the following pattern:

The %V format specification is used not only by error logging, so 
this patch is certainly wrong.  Note well that not escaped strings 
in some cases are logged intentionally, e.g., in debugging logs.  
Another question to consider is performance, it may be quite 
important during logging, especially debug one.  And note well 
that not only %V format specification can be used to log strings.

We have ticket #191 in Trac about making error logs 
machine-parseable (see https://trac.nginx.org/nginx/ticket/191), 
but there are lots of open questions on how to do it properly.

Maxim Dounin

More information about the nginx-devel mailing list