custom proxy_access_log still not working in 3.4.* #12954
Labels
pending author feedback
Waiting for the issue author to get back to a maintainer with findings, more details, etc...
stale
Is there an existing issue for this?
Kong version (
$ kong version
)kong/kong-gateway:3.4.3.6
Current Behaviour
docker run fails with
nginx: [emerg] unknown log format "custom-json" in /usr/local/kong/nginx-kong.conf
I have set environment variable
KONG_PROXY_ACCESS_LOG=/dev/stdout\ customer-json \
as per the instructions in the issue #12061.Also
custom-json.conf
is included in nginx.conf http block.http { include 'custom-json.conf'; include 'nginx-kong.conf'; }
Below is how
custom-json.conf
looks like.log_format custom-json escape=json '{' '"consumer":"$http_x_consumer_username",' '"consumer_id":"$http_x_consumer_id",' '}';
Expected Behaviour
docker-compose run successfully build the image and able to run the container with the new log formatter.
Steps To Reproduce
custom-json.conf
looks like this (this could be any format)docker-compose build
nginx: [emerg] unknown log format "customer-json" in /usr/local/kong/nginx-kong.conf
Anything else?
It seems that Kong always expects log_format definitions to be inside the nginx-kong.conf. If we create a new log formatter and add it to the http block inside the kong.conf, Kong fails to fetch it. Normally, nginx accepts custom log formatters via the http block. There is a simple workaround to overcome this issue, but I would like to know the recommended solution.
The text was updated successfully, but these errors were encountered: