查看docker容器日志

容器里面的服务运行报错了,要查看容器的日志

要查看 Docker 容器的日志,可以使用 docker logs 命令。以下是一些常见的使用方法:

基本用法

复制代码
docker logs <container_name_or_id>

查看最近的日志

复制代码
docker logs --tail 100 <container_name_or_id>

查看实时日志

复制代码
docker logs --f <container_name_or_id>

查看带有时间戳的日志

如果需要查看带有时间戳的日志,可以使用 -t 选项:

复制代码
docker logs -t <container_name_or_id>
相关推荐
白菜欣1 小时前
Linux — 进程控制
android·linux·运维
JoneBB2 小时前
ABAP Webservice连接
运维·开发语言·数据库·学习
Tolalal2 小时前
Vmware Ubuntu虚拟机扩容
linux·运维·ubuntu
修己xj3 小时前
别再让Docker占满你的硬盘!一篇搞定docker system所有命令
docker
咚为3 小时前
比AccessLog更全面的原生Nginx 日志记录
运维·nginx·junit
我星期八休息3 小时前
Linux系统编程—基础IO
linux·运维·服务器·c语言·c++·人工智能·算法
a752066283 小时前
零基础实操:小龙虾 AI OpenClaw 接入 Kimi 详细步骤
运维·服务器
Goldbioinformatics4 小时前
Windows版Claude Cowork启动Linux问题
linux·运维·windows
念恒123064 小时前
Ext系列文件系统(下)
linux·运维·服务器