[PATCH] Escape characters in log files

David Phillips david at acz.org
Sat Jan 19 01:24:37 MSK 2008


(re-sending with the patch actually attached)

The attached patch escapes characters in log file entries.  It works
similar to Apache:

* Any non-printable characters (<= 31 or >= 127) or pipe characters
are escaped using \xhh
* Whitespace (tab, newline, vertical tab, form feed, carriage return)
characters use C-style escapes
* Double quotes or backslashes are prefixed with a backslashes

Pipes are escaped to allow for easy handling of raw logs when using
pipes as the delimiter: you can split on a pipe without any parsing.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: log-escape.patch
Type: text/x-patch
Size: 2602 bytes
Desc: not available
URL: <http://nginx.org/pipermail/nginx/attachments/20080118/965a6cb4/attachment.bin>


More information about the nginx mailing list