Log api_name from nginx.template file

I’m adding a custom log from nginx.template file. I want to write the api_name as well it process for current request. Is that an option which I can get the api_name in nginx.template file?