Three ways for docker to view logs

There are three ways for docker to view logs:

1.docker logs --tail=1000 container name (check how many lines of logs before the container)

2. After the docker container is started, you can enter the following location to view the log (/var/lib/docker/containers/container ID/container ID-json.log) (enter the container to view the log)

3. docker attach container name (view in real time, but CTRL+C forced exit will also affect the process of the container, resulting in forced exit), set docker attach --sign-proxy=false container name (view log content in real time)

Guess you like

Origin blog.csdn.net/taoshihan/article/details/132375344