No Request or Response or Error logs in Kubernetes Ingress Controller logs

Hi All,

I recently deployed kong as a kubernetes ingress controller and setup a service and ingress to route the requests through kong, But I’m unable to monitor anything for the requests going through kong to the configured service. Neither request/response logs are being printed in pod logs (stdout) nor written to the file.
The configuration for logs in the helm chart is as below:

  proxy_access_log: /dev/stdout
  admin_access_log: /dev/stdout
  admin_gui_access_log: /dev/stdout
  portal_api_access_log: /dev/stdout
  proxy_error_log: /dev/stderr
  admin_error_log: /dev/stderr
  admin_gui_error_log: /dev/stderr
  portal_api_error_log: /dev/stderr

I need your help to understand how we can setup/enable logs (access logs) for kong controller either in pod logs or to the file.
Our goal is to monitor kong access logs in the monitoring tool like Datadog.

Please help us on this.

Happy Kong!

thanks,
Natesh

Can anyone please reply on this? @traines

Have you tried to change the log level?

Use the same “env” section for this.

Yes, I have tried changing the log level to debug/error/info etc, but no help. I am only able to see the access logs when I run the command kubectl logs api-gateway proxy -n kong, But I want them in stdout, so that I can easily push them to datadog for monitoring.

I am currently able to see only the following logs in pod logs:

time="2022-10-27T05:55:19Z" level=info msg="successfully synced configuration to kong."
time="2022-10-27T05:55:22Z" level=error msg="checking config status failed" error="HTTP status 500 (message: \"An unexpected error occurred\")"
time="2022-10-27T05:55:25Z" level=error msg="checking config status failed" error="HTTP status 500 (message: \"An unexpected error occurred\")"
time="2022-10-27T05:55:28Z" level=error msg="checking config status failed" error="HTTP status 500 (message: \"An unexpected error occurred\")"
time="2022-10-27T05:55:31Z" level=error msg="checking config status failed" error="HTTP status 500 (message: \"An unexpected error occurred\")"

You want the proxy container logs, not the controller logs: kubectl logs PODNAME -c proxy

The controller only generates configuration for the proxy; the proxy actually processes requests.

@traines Can u please let us know how and what is the recommended way to push the kong proxy logs to Datadog.

There is a Datadog plugin that provides aggregate metrics.

Access logs are available via a variety of protocols. Those aren’t in NGINX format like the stdout log, but they provide the same information and more. The TCP logger, for example, should be fine for sending logs to Datadog’s TCP ingest.