Since I had to look for a long time, I picked up bits of answers from different places and am compiling it here for anyone who is stuck.
After running the container, go to the terminal and post the following commands.
(I used pycharm and the terminal started inside the directory where my code and dockerfile were stored)
docker ps
(this shows the containers running currently)
docker exec -it 'container-name' bash
(now you have entered the container)
ls -lsa
(this will show all the files in the container, including the log file)
cat info.log
Now, you can see the log file contents on the terminal.
I have made a Flask API for a spacy ner code and deployed it on Docker. In the code I have used python's logging to return the outputs to a file, info.log.
The question is, how to access the log file in the container after running it.
Python logging in Docker. How to access log file formed inside the Docker container