从本地的 Bluemix Liberty docker 映像 运行 访问 Liberty 日志文件
Accessing Liberty log files from the Bluemix Liberty docker image running locally
我的目标是开发一个应用程序,该应用程序将 运行 在 Docker 中托管的 WebSphere Liberty 上,并最终 运行 在 Bluemix 上运行。在开发过程中,我在本地 Linux PC 上安装了 Docker,然后从 IBM 下载了包含已配置 Liberty 的基本 docker 映像。此图像称为:
registry.ng.bluemix.net/ibmliberty
我现在在我的 PC 本地启动此图像 Docker 并附加一个 shell 以便我可以看到发生了什么。我发现有一个 Liberty 服务器位于
/opt/ibm/wlp/usr/servers/defaultServer
谜题来了。
在我习惯使用的 Liberty 服务器中,服务器产生的消息被写入与服务器相关的 "logs/messages.log" 文件中。这意味着我会期望在此处找到 Liberty 消息文件:
/opt/ibm/wlp/usr/servers/defaultServer/logs/messages.log
但是,当我启动我的服务器时,那里什么也没有。
如何在我的 Linux 环境中访问从 Docker 下的 Bluemix 基础映像 (registry.ng.bluemix.net/ibmliberty
) 运行ning 获取的 Liberty 服务器日志我的本地电脑?
如果我们检查这个 IBM Liberty/Bluemix 文档页面:
https://console.bluemix.net/docs/images/docker_image_ibmliberty/ibmliberty_starter.html
我们会找到一个部分,上面写着:
Note: All ibmliberty images are configured to write Liberty log files to the directory /logs inside the container. All other files that are written by the Liberty server, are created in the directory /opt/ibm/wlp/output/defaultServer. You can access these files by using the shortcut /output.
这是关键。 Liberty 服务器日志文件可以在 /logs
(即文件系统根目录以南名为 logs
的目录)中找到。
我的目标是开发一个应用程序,该应用程序将 运行 在 Docker 中托管的 WebSphere Liberty 上,并最终 运行 在 Bluemix 上运行。在开发过程中,我在本地 Linux PC 上安装了 Docker,然后从 IBM 下载了包含已配置 Liberty 的基本 docker 映像。此图像称为:
registry.ng.bluemix.net/ibmliberty
我现在在我的 PC 本地启动此图像 Docker 并附加一个 shell 以便我可以看到发生了什么。我发现有一个 Liberty 服务器位于
/opt/ibm/wlp/usr/servers/defaultServer
谜题来了。
在我习惯使用的 Liberty 服务器中,服务器产生的消息被写入与服务器相关的 "logs/messages.log" 文件中。这意味着我会期望在此处找到 Liberty 消息文件:
/opt/ibm/wlp/usr/servers/defaultServer/logs/messages.log
但是,当我启动我的服务器时,那里什么也没有。
如何在我的 Linux 环境中访问从 Docker 下的 Bluemix 基础映像 (registry.ng.bluemix.net/ibmliberty
) 运行ning 获取的 Liberty 服务器日志我的本地电脑?
如果我们检查这个 IBM Liberty/Bluemix 文档页面:
https://console.bluemix.net/docs/images/docker_image_ibmliberty/ibmliberty_starter.html
我们会找到一个部分,上面写着:
Note: All ibmliberty images are configured to write Liberty log files to the directory /logs inside the container. All other files that are written by the Liberty server, are created in the directory /opt/ibm/wlp/output/defaultServer. You can access these files by using the shortcut /output.
这是关键。 Liberty 服务器日志文件可以在 /logs
(即文件系统根目录以南名为 logs
的目录)中找到。