Home > Operation and Maintenance > Docker > How to read logs when something goes wrong with docker

How to read logs when something goes wrong with docker

Release: 2020-03-31 09:48:36
Original
3094 people have browsed it

How to read logs when something goes wrong with docker

How docker read the container error log? Docker containers may sometimes experience application failures. When troubleshooting, we can check the error logs.

View container application log

1. Enter the following command on the command line to view the stdout/stderr log of the specified container

docker logs |
Copy after login

2. View the last 100 lines of the specified container Log

docker logs --tail=100|
Copy after login

3. Using the console web interface, in addition to obtaining the log information of a single container, you can also obtain the log information of specified applications and service aggregates. After selecting the specified application and service, select the "Log" tab.

Note: If the container log is output in a file, it is recommended to collect the container log through the integration of the container service and the log service.

Enter the docker ps command on the command line to list all running containers in the cluster; docker ps -a can list all containers in the cluster (including non-running containers)

For more related tutorials, please pay attention to the docker tutorial column on the PHP Chinese website.

The above is the detailed content of How to read logs when something goes wrong with docker. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template