Conditional access_log

How can I disable log to access_log based on a runtime condition?
Example that does not works:

    if ($http_user_agent ~* httperf) {
      access_log off;
    }

thanks in advance.

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs