Escape characters in log files

David Phillips david at acz.org
Fri Jan 18 04:01:24 MSK 2008


On Jan 15, 2008 2:48 AM, Manlio Perillo <manlio_perillo at libero.it> wrote:
> Can you post an example, thanks?

Request:

GET / HTTP/1.0
Referer: xxx"yyy

nginx log:

127.0.0.1 - - [16/Jan/2008:18:58:03 -0600] "GET / HTTP/10" 403 202 "xxx"yyy" "-"

Apache log:

127.0.0.1 - - [16/Jan/2008:18:58:03 -0600] "GET / HTTP/1.0" 403 202
"xxx\"yyy" "-"

> Modify the http log module.
>
> I think you only need to modify the ngx_http_log_variable_getlen and
> ngx_http_log_variable functions.

You're right, it's simpler than I thought.  I was concerned about the
performance overhead of escaping variables that are known to be good,
but they are already special-cased by ngx_http_log_vars.





More information about the nginx mailing list