Hello Team, I used log_by_lua_file in different contexts, one is in the server, one is in the location, and actually only the log_by_lua_file in the location is executed. Who can explain why?
thx!
Hello, Only one *_by_lua_block of each type (rewrite, access, etc...) will be executed for each request. This is by design. There are **numerous** threads both in this email list[1][2][3] and on the ngx_lua repository issues[4] discussing this topic. Best, Thibault [1]: https://groups.google.com/d/msg/openresty-en/Y14S4e18u9o/-oJkhHklBQAJ [2]: https://groups.google.com/forum/#!msg/openresty-en/6noMXQei0O0/CXsJHJqZCwAJ;context-place=msg/openresty-en/Y14S4e18u9o/aPieT9QrBQAJ [3]: https://groups.google.com/forum/m/#!topic/openresty-en/0RmRy6Q2DOA [4]: https://github.com/openresty/lua-nginx-module/issues On 5/23/19 2:02 AM, xiaoxi mou wrote: > Hello Team, I used log_by_lua_file in different contexts, one is in the server, one is in the location, and actually only the log_by_lua_file in the location is executed. Who can explain why? > > thx!.