# Disable access log escaping

**URL:** <https://www.ruby-forum.com/t/disable-access-log-escaping/245716>\
**Category:** NGINX\
**Created:** [July 3, 2013, 9:55pm UTC](https://www.ruby-forum.com/t/disable-access-log-escaping/245716 "2013-07-03T21:55:01Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Rafa\_F](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/958977/32.png) [@Rafa\_F](https://www.ruby-forum.com/u/Rafa_F)\
**Post date:** [July 3, 2013, 9:55pm UTC](https://www.ruby-forum.com/t/disable-access-log-escaping/245716/1 "2013-07-03T21:55:01Z")

</div>

Hi,

I’m using a module which sets some data formated as json to a variable.  
I’m  
trying to log this variable using the access log, but the content is  
escaped. I’m getting something like {\x22foo\x22:\x22bar\x22} instead of  
{‘foo’:‘bar’}.

Is there a way to disable the escaping per access\_log or per log\_format?

---

<div class="post-metadata">

**Author:** ![Calin\_D](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/3be4f8/32.png) [@Calin\_D](https://www.ruby-forum.com/u/Calin_D)\
**Post date:** [July 4, 2013, 12:33am UTC](https://www.ruby-forum.com/t/disable-access-log-escaping/245716/2 "2013-07-04T00:33:23Z")

</div>

On Wed, Jul 03, 2013 at 10:54:15PM +0300, Calin D. wrote:

Hi there,

> I’m using a module which sets some data formated as json to a variable. I’m  
> trying to log this variable using the access log, but the content is  
> escaped. I’m getting something like {\x22foo\x22:\x22bar\x22} instead of  
> {‘foo’:‘bar’}.

\x22 should correspond to ".  
’ would correspond to \x27, but I don’t think that is escaped (I didn’t  
look at the newest source).

Anyway…

> Is there a way to disable the escaping per access\_log or per log\_format?

I don’t believe so (using only nginx configuration). It will probably be  
easier for your log-reading code to unescape the four characters  
starting  
“\x” before further processing.

## f

Francis D. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)
