0
0
Dockerdevops~10 mins

Docker logs for troubleshooting - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the command to view logs of a Docker container named webapp.

Docker
docker logs [1]
Drag options to blanks, or click blank then click option'
Arun
Bstart
Cwebapp
Dstop
Attempts:
3 left
💡 Hint
Common Mistakes
Using commands like start or stop instead of the container name.
Forgetting to specify any container name.
2fill in blank
medium

Complete the command to follow the live logs of a container named db.

Docker
docker logs [1] db
Drag options to blanks, or click blank then click option'
A-f
B--tail
C--help
Drun
Attempts:
3 left
💡 Hint
Common Mistakes
Using --tail which only shows last lines but does not follow.
Using run which is not a valid option here.
3fill in blank
hard

Fix the error in the command to show only the last 50 lines of logs for container api.

Docker
docker logs --tail=[1] api
Drag options to blanks, or click blank then click option'
A100
B50
C0
Dall
Attempts:
3 left
💡 Hint
Common Mistakes
Using 100 which shows more lines than needed.
Using 'all' which is not a valid number.
4fill in blank
hard

Fill both blanks to show the last 20 lines and follow live logs of container cache.

Docker
docker logs [1] [2] cache
Drag options to blanks, or click blank then click option'
A-f
B--tail=20
C--follow
D--since=1h
Attempts:
3 left
💡 Hint
Common Mistakes
Using --since=1h which filters by time, not lines.
Mixing order of options incorrectly.
5fill in blank
hard

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
docker logs [1] [2] [3] worker
Drag options to blanks, or click blank then click option'
A--since=10m
B-f
C--tail=100
D--timestamps
Attempts:
3 left
💡 Hint
Common Mistakes
Using --timestamps which adds timestamps but does not filter or follow.
Mixing up the order of options.