Is it possible to have more than one custom log format?

Currently we can modify the kong logging format by setting up the format in the field: nginx_http_log_format

I have a requirement where I need a format for logging the access and different format for logging the error

I would like to use as below,
KONG_PROXY_ACCESS_LOG=/dev/stdout access_format
KONG_PROXY_ERROR_LOG=/dev/stderr error_format

If I try to set up 2 environment variable for KONG_NGINX_HTTP_LOG_FORMAT one with access_format and another one with error_format, only one remains and another gets auto deleted.
I tried setting both the format with ; as separator, which did not work as well.

Suggest a way as to how I can use multiple logging formats…

Which Kong version do you use?

In the current version it works as you described. You have at least 4 separate variables defining the log format: PROXY_ERROR_LOG, PROXY_ACCESS_LOG, ADMIN_ERROR_LOG and ADMIN_ACCESS_LOG (of course with the requred “KONG_” prefix).

You can see the source-code here on GitHub: kong/kong/templates/nginx_kong.lua at master · Kong/kong · GitHub