Kong Community Edition (KongCE) - Kong logs on Docker

by
Jeremy Canfield |
Updated: March 22 2021
| Kong Community Edition (KongCE) articles
When Kong is deployed to a Docker container, the docker logs command can be used to view the Kong logs.
The docker ps command can be used to determine if the Kong container is running.
docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
d937372c09ab9 b939aa938add9913 "/docker-entrypoin..." 6 minutes ago Created kong001
Assuming the Kong container is running, the docker logs command can be used to view the Kong log.
docker logs kong001
The -t or --timestamps option can be included to include the datetime in the output.
docker logs --timestamps kong001
The --since and --until options can be used to only display events within a specified datetime.
docker logs --since 2020-11-14T08:00:00 --until 2020-11-14T11:00:00 kong001
The --tail=10 option can be included to only list the last 10 messages in the log.
docker logs --tail=10 kong001
You may need to use 2>&1 to grep the logs.
docker logs kong001 2>&1 | grep foo
Did you find this article helpful?
If so, consider buying me a coffee over at