# Error response body log basic.lua

**URL:** <https://discuss.konghq.com/t/error-response-body-log-basic-lua/1700>\
**Category:** General\
**Created:** [August 16, 2018, 10:47pm UTC](https://discuss.konghq.com/t/error-response-body-log-basic-lua/1700 "2018-08-16T22:47:12Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![andre](https://avatars.discourse-cdn.com/v4/letter/a/6de8d8/32.png) [@andre](https://discuss.konghq.com/u/andre)\
**Post date:** [August 16, 2018, 10:47pm UTC](https://discuss.konghq.com/t/error-response-body-log-basic-lua/1700/1 "2018-08-16T22:47:12Z")

</div>

I changed file basic.lua for log body response.  
I see in error.log message “API disabled in the context of log\_by\_lua\*”.  
I don’t know how can i change or what´s going on .

Thanks.

---

<div class="post-metadata">

**Author:** ![thibaultcha](https://yyz2.discourse-cdn.com/flex036/user_avatar/discuss.konghq.com/thibaultcha/32/340_2.png) [@thibaultcha](https://discuss.konghq.com/u/thibaultcha)\
**Post date:** [August 17, 2018, 1:49am UTC](https://discuss.konghq.com/t/error-response-body-log-basic-lua/1700/2 "2018-08-17T01:49:16Z")

</div>

Hi,

You should read the [ngx\_lua documentation](https://github.com/openresty/lua-nginx-module#nginx-api-for-lua) to make sure that you did not call a function that cannot be used in the `log_by_lua_*` phase. You can see that each function there has a “context” section describing the supported contexts.

Accessorily, sharing with us the edits you made to this file would have been helpful, as we could have pointed out the mistake to you 🙂
