How do we enable debug log on different platforms?
How to enable debug log
How do I enable debug logging in Kong Gateway?
Set log_level = debug in kong.conf, or set the KONG_LOG_LEVEL=debug environment variable (for Docker, Kubernetes, or Helm deployments), then reload or restart Kong. Kong Gateway also supports Dynamic Log Levels, which let you raise or lower the log level without restarting Kong, except in DB-less mode where the Admin API isn’t available.
Steps
VM:
There are two ways of changing the log level.
-
On the
/etc/kong/kong.conffile, changelog_level=debug -
Adding the environment variable
KONG_LOG_LEVEL=debugwill override the setting on the config file.
Docker:
Normally we use environment variables to configure Kong containers. Please add KONG_LOG_LEVEL=debug to your docker run command or docker compose file under environment.
Kubernetes:
You can modify the deployment and add the below to the Kong container
- name: KONG_LOG_LEVEL
value: debugIf you deploy with Helm, you can add log_level under env as below
env:
log_level: debugOnce the changes are made, please remember to reload/restart Kong. For Kubernetes, please remember to apply the deployment file or upgrade your Helm release to bring up a new pod with this configuration.
Dynamically:
Kong Gateway supports Dynamic Log Levels to allow log levels to be increased and decreased without the need to restart Kong.
Caveat: Cannot work in DBLess mode as there is no admin-api available.
For more details, please review the documentation.