Forrest logo
back to the docker tool

docker:tldr:4ba83

docker: Fetch and follow the logs of a container.
$ docker logs -f ${container_name}
try on your machine

The command docker logs -f ${container_name} is used to view the real-time log output of a specific Docker container.

Here's a breakdown of the command:

  • docker logs: This is the Docker command used to retrieve the logs of a container.
  • -f or --follow: This flag tells Docker to continuously stream the logs as new lines are added, following the output.
  • ${container_name}: This is the placeholder for the name or identifier of the container whose logs you want to view. You would need to replace ${container_name} with the actual name or ID of your desired container.

By running this command, Docker will display the log output of the specified container in your terminal. The -f flag ensures that new log entries are shown as they happen, giving you real-time updates.

This explanation was created by an AI. In most cases those are correct. But please always be careful and never run a command you are not sure if it is safe.
back to the docker tool