1. 查看运行着的容器

docker ps -a

docker查看运行容器日志的步骤

2. 查看容器日志命令

docker logs [OPTIONS] CONTAINER
 
[OPTIONS]
 
-f : 跟踪日志输出
 
-t : 显示时间戳
 
--tail :仅列出最新N条容器日志
 
--since:显示某个日期至今的所有日志
 
CONTAINER
代表容器ID或容器名称  

3. 查看最近10条日志, 并持续打印

docker logs -f --tail 10 efb78392fcc6

docker查看运行容器日志的步骤

4. 查看某个日期至今的所有日志, 并持续打印

docker logs -f --since "2022-05-16" efb78392fcc6
原文地址:https://blog.csdn.net/weixin_43652507/article/details/124795228

相关文章:

  • 2021-11-04
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-11-28
  • 2021-10-29
  • 2021-09-04
相关资源
相似解决方案