Disable logging for certain response

Hi
I am using nginx lua to return a 302 for certain requests - probably
about 50% of total requests

e.g. (lua code)

    if (res.status == ngx.HTTP_MOVED_TEMPORARILY) then
            local loc = res.header["X-Location"]
            if (ngx.var.is_args == '?') then
                    loc = loc .. '?' .. ngx.var.args
            end
            return ngx.redirect(loc)

The other 50% are processed normally and a full reponse is returned

I do not need to log the 302 responses, and indeed it is causing a much
waste of processor time when I come to analyse/process the logs (this is
100s of gigabytes of logs per day - so is a HUGE waste)

Is there any way to set a var prior to returning the 302 which will
cause nginx not to log it?

Richard K.
Systems Developer | M247 Limited
Internal Dial 2210 | Mobile +44 7970 621236