How to see the logs of a docker container

0 votes

I have a small piece of code for which I've constructed a Docker container, and the status indicates that it's up and running. To print the data, I used some print() commands within the code. I was curious about the output of the print command.

I've seen Docker logs for this. However, it does not appear to be operating because no logs are displayed. What is the best way to check logs?

$ sudo docker ps
CONTAINER ID        IMAGE                        COMMAND                  CREATED             STATUS              PORTS                                            NAMES
a3b3fd261b94        firstdocker                     "python3 ./my_script…"   22 minutes ago      Up 22 minutes                                                        elegant_darwin

 $ sudo docker logs a3b3fd261b94
<shows nothing>
Apr 28, 2022 in Docker by Abhijeet
• 180 points

edited 5 days ago 4 views

No answer to this question. Be the first to respond.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP