What is the best way to find a specific string in the logs of a docker container? Let\'s say I want to see all requests, that are made in the \"nginx\" docker image that came fr
First, use this command ( b1e3c456f07f is the container id ):
docker inspect --format='{{.LogPath}}' b1e3c456f07f
The result will be something like this:
/var/lib/docker/containers/b1e3c456f07f2cb3ae79381ada33a034041a10f65174f52bc1792110b36fb767/b1e3c456f07f2cb3ae79381ada33a034041a10f65174f52bc1792110b36fb767-json.log
Second, use this command ( you can use vim if you like ):
nano /var/lib/docker/containers/b1e3c456f07f2cb3ae79381ada33a034041a10f65174f52bc1792110b36fb767/b1e3c456f07f2cb3ae79381ada33a034041a10f65174f52bc1792110b36fb767-json.log