How to view logs of docker cluster containers?
To view cluster logs, you can log in to your container cloud Web console. After selecting the cluster, click "View Logs" in the pop-up window to obtain log information about cluster operations.
From the container list, you can get the container and its corresponding node information; from the cluster node list, click on the specified node to get the corresponding node monitoring information.
View the log of container restart in the docker swarm cluster, which can be found in the linux system log. For centos, you can view it through the following command
cat /var/log/messages | grep "dockerd.*exceeded"
Docker container logs are generally stored in /var/lib/ Under docker, you can use the following command to view the file size of each log
ls -lh $(find /var/lib/docker/containers/ -name *-json.log)
To view the logs of the container, you can use the docker logs command
sudo docker logs -f -t --tail 行数 容器名
For more related tutorials, please pay attention to the PHP Chinese websitedocker tutorial column.
The above is the detailed content of How to view logs of docker cluster container. For more information, please follow other related articles on the PHP Chinese website!