Hello!
On Fri, May 27, 2016 at 6:42 PM, Jamie Wang wrote:
> can we control the access_log directive based on condition like this :
>
> location /foo {
> set $cond 0;
> log_by_lua_file 'test.lua';
> if ( $cond = 1 ) {
> access_log "/data/spec.log";
> }
The access_log directive supports the postfix if form. See
http://nginx.org/en/docs/http/ngx_http_log_module.html#access_log
Regards,
-agentzh