Docker Checking logs

Check all the logs:
docker-compose -f <DOCKER_COMPOSE_FILE_NAME> logs

Check logs for a particular container:
docker-compose -f <DOCKER_COMPOSE_FILE_NAME> logs <CONTAINER_NAME>

We can also use the below command to tail the logs
docker-compose -f <DOCKER_COMPOSE_FILE_NAME> logs -f <CONTAINER_NAME>

docker-compose -f <DOCKER_COMPOSE_FILE_NAME> logs –follow <CONTAINER_NAME>

Check the log by container name:

  • Get the container name by running the below command
    docker ps
  • Then get the container name of the service for which we want to check the logs
    docker logs <>
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s