查看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>
相关推荐
Danileaf_Guo3 小时前
256台H100服务器算力中心的带外管理网络建设方案
运维·服务器
拾贰_C5 小时前
【Linux | Windows | Terminal Command】 Linux---grep | Windows--- findstr
linux·运维·服务器
bloglin999995 小时前
启动容器报错ls: cannot access ‘/docker-entrypoint-initdb.d/‘: Operation not permitted
docker·容器·eureka
songjxin6 小时前
离线部署kubernetes v1.34.3
云原生·容器·kubernetes
虹科网络安全6 小时前
艾体宝洞察 | 利用“隐形字符”的钓鱼邮件:传统防御为何失效,AI安全意识培训如何补上最后一道防线
运维·网络·安全
石像鬼₧魂石6 小时前
Kali Linux 网络端口深度扫描
linux·运维·网络
alengan6 小时前
linux上面写python3日志服务器
linux·运维·服务器
yBmZlQzJ7 小时前
免费内网穿透-端口转发配置介绍
运维·经验分享·docker·容器·1024程序员节
JH30737 小时前
docker 新手入门:10分钟搞定基础使用
运维·docker·容器
小卒过河01048 小时前
使用apache nifi 从数据库文件表路径拉取远程文件至远程服务器目的地址
运维·服务器·数据库