Home > Article > Operation and Maintenance > 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
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分钟)
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!