Finding a string in docker logs of container

前端 未结 8 1205
南方客
南方客 2021-01-30 01:21

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

8条回答
  •  情话喂你
    2021-01-30 02:15

    I generally use it with -f option as well, when I am debugging the issue

    docker logs -f nginx 2>&1 | grep "127."
    

    It will show us, what we are expecting in real-time.

提交回复
热议问题