-
Notifications
You must be signed in to change notification settings - Fork 4.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
custom proxy_access_log still not working in 3.4.* #12954
Comments
I am sharing the workaround I have implemented in case others experience the same issues.
Hope this helps :) |
Hi @ravigunasekara, thank you for opening this issue. I couldn't reproduce it in Thank you. |
This issue is marked as stale because it has been open for 14 days with no activity. |
Dear contributor, We are automatically closing this issue because it has not seen any activity for three weeks. Your contribution is greatly appreciated! Please have a look Sincerely, |
Thanks and Sorry for the delayed reply @samugi. I was holidaying and just came back. I have setup my environment variable such a way ( |
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: