In which directory are the docker container logs located?

Release: 2020-03-31 11:38:31
Original
6646 people have browsed it

In which directory are the docker container logs located?

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 container log

docker logs 容器ID
Copy after login

Command format:

$ docker logs [OPTIONS] CONTAINER
  Options:
        --details        显示更多的信息
    -f, --follow         跟踪实时日志
        --since string   显示自某个timestamp之后的日志,或相对时间,如42m(即42分钟)
        --tail string    从日志末尾显示多少行日志, 默认是all
    -t, --timestamps     显示时间戳
        --until string   显示自某个timestamp之前的日志,或相对时间,如42m(即42分钟)
Copy after login

For more related tutorials, please pay attention to the PHP Chinese websitedocker tutorial Column.

The above is the detailed content of In which directory are the docker container logs located?. 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!