如何连接到 Docker 容器内的 Spring Boot 日志

huangapple go评论95阅读模式
英文:

How to connect to spring boot logs inside docker container

问题

我在远程服务器上的 Docker 容器内运行了一个 Spring Boot Java 应用程序。当我使用 docker-compose up 命令启动它时,我可以看到应用程序的日志。现在我想再次查看它,但不知道如何再次连接到我的应用程序控制台。

我已经通过 "docker exec -it bash" 命令连接到了 Docker 容器终端。但是不知道接下来该怎么做。谢谢你的帮助。

英文:

I have spring boot java application running inside docker container at remote server. When I started it with docker-compose up command, I could see logs of my application. Now I want to see it again, but don't understand how to connect to my application console again.

I have connected to docker container terminal via "docker exec -it bash" command. But have no idea what to do next. Thank you for you help.

答案1

得分: 0

我使用 docker-compose up 命令启动了它。

假设容器仍在运行,您可以使用 docker-compose logs,如果不是,则需要重新运行 up

英文:

> I started it with docker-compose up command

Assuming the contiainer is still running, you would use docker-compose logs, if not then you need to re-run up.

huangapple
  • 本文由 发表于 2023年6月6日 04:02:39
  • 转载请务必保留本文链接:https://go.coder-hub.com/76409649.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定