Complete the command to view logs of a Docker container named webapp.
docker logs [1]The docker logs command followed by the container name webapp shows the logs of that container.
Complete the command to follow the live logs of a container named db.
docker logs [1] db--tail which only shows last lines but does not follow.run which is not a valid option here.The -f option means 'follow' and shows live logs as they come.
Fix the error in the command to show only the last 50 lines of logs for container api.
docker logs --tail=[1] apiThe --tail=50 option shows the last 50 lines of logs.
Fill both blanks to show the last 20 lines and follow live logs of container cache.
docker logs [1] [2] cache
--since=1h which filters by time, not lines.Use --tail=20 to show last 20 lines and -f to follow live logs.
Fill all three blanks to show logs since 10 minutes ago, follow live logs, and limit output to last 100 lines for container worker.
docker logs [1] [2] [3] worker
--timestamps which adds timestamps but does not filter or follow.--since=10m shows logs from last 10 minutes, -f follows live logs, and --tail=100 limits output to last 100 lines.