Suggest an editImprove this articleRefine the answer for “How do you view container logs?”. Your changes go to moderation before they’re published.Approval requiredContentWhat you’re changing🇺🇸EN🇺🇦UAPreviewTitle (EN)Short answer (EN)Container logs are shown with the **`docker logs`** command. **Key point:** Docker shows the container's stdout and stderr - what the application prints to the console.Shown above the full answer for quick recall.Answer (EN)ImageContainer logs are shown with the `docker logs` command. ### **1. View the container's logs** ```bash docker logs CONTAINER_NAME ``` or by ID: ```bash docker logs CONTAINER_ID ``` ### **2. Watch logs in real time (like** `tail -f`**)** ```bash docker logs -f CONTAINER_NAME ``` ### **3. Specify the number of last lines** ```bash docker logs --tail 50 CONTAINER_NAME ``` ### **4. View logs with timestamps** ```bash docker logs -t CONTAINER_NAME ``` ### **Summary** | Task | Command | |---|---| | One-time log view | `docker logs NAME` | | Streaming logs | `docker logs -f NAME` | | Last X lines | `docker logs --tail X NAME` | Docker shows the container's **stdout and stderr** - what the application prints to the console.For the reviewerNote to the moderator (optional)Visible only to the moderator. Helps review go faster.