Where are the logs after the docker container is started?

Release: 2020-04-02 14:32:40
Original
6861 people have browsed it

Where are the logs after the docker container is started?

After docker is started, the log will be in the following location

/var/lib/docker/containers/container ID/container ID-json.log

You can also use the following command to view the log:

docker logs 容器ID
Copy after login

Use docker-compose to record the log to a local file through configuration

The directory structure is as follows, among which the conf under mysql Place the configuration file data as the database file log as the mysql running log

##root@zssj-magic-box:/data/docker-compose# tree -L 2

.

├── docker-compose.yml

└── mysql

├── conf

├── data

└── log

For more related tutorials, please pay attention to the

docker tutorial column on the PHP Chinese website.

The above is the detailed content of Where are the logs after the docker container is started?. 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
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!