来自容器的日志的日志文件在哪里? [英] Where is a log file with logs from a container?
本文介绍了来自容器的日志的日志文件在哪里?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我使用 docker-compose
运行多个容器。我可以通过命令 docker-compose logs
看到应用程序日志。但是,我想访问原始日志文件以将其发送到某个地方,例如:它在哪里?我想这是每个容器(容器内部)分开的日志,但在哪里可以找到?
I am running several containers using docker-compose
. I can see application logs with command docker-compose logs
. However I would like to access raw log file to send it somewhere for example? Where is it located? I guess it's separate log per each container (inside container?) but where I can find it?
推荐答案
容器的日志可以是发现于:
A container's logs can be found in :
/var/lib/docker/containers/<container id>/<container id>-json.log
(如果您使用json的默认日志格式)
(if you use the default log format which is json)
这篇关于来自容器的日志的日志文件在哪里?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文